Number type input validation problem if number type input depends on other input
forgie1 opened this issue · comments
Version: 3.3.0 and others
Bug Description
If input is of type number
and depends on other input and number
validation fails, than form is not valid but no error is added to Nette.formErrors
. Even no further errors are added.
Steps To Reproduce
protected function createComponentTest(): Nette\Application\UI\Form
{
$form = new Nette\Application\UI\Form();
$dep = $form->addCheckbox('dep', 'Num required');
$num = $form->addText('num', 'Number');
$num->setHtmlAttribute('type', 'number');
$num->addConditionOn($dep, $form::EQUAL, true)->setRequired();
$form->addText('required', 'Required')->setRequired();
$form->addSubmit('submit', 'done');
return $form;
}
Check the checkbox.
Enter non numeric value, eg 5X
to Number
field.
Do not fill Required
field.
And submit the form.
No error is displayed.
Expected Behavior
Two errors should be displayed:
- Please enter a valid value.
- This field is required.