Form with empty input select – bug

Notice: This thread is very old.
Budry
Member | 88
+
0
-

Hi,
I found bug (maybe) in Nette dev-master from github.
I can't send form if contain empty input select and form is manually rendered

{form test}
	{dump $form->errors} // no errors
	{input select}
	{input send}
{/form}
protected function createComponentTest()
{
	$form = new Nette\Application\UI\Form();
	$form->addSelect('select', null, array());
	$form->addSubmit('send', 'Send');
	$form->onSuccess[] = $this->submitted;

	return $form;
}

public function submitted(Nette\Application\UI\Form $form)
{
	dump($form);
}

If Iuse {control test} error is displayed but form isn't sended

In 2.0.10 is everything is OK – I can send form though input select is empty

I'm sorry for my English

Last edited by Budry (2013-07-10 13:49)

David Grudl
Nette Core | 8110
+
0
-

In dev-master, you should use $form->allErrors. Errors for selectbox are in $form[select]->errors.

But this is compatibility issue and should be somehow solved…

Budry
Member | 88
+
0
-

Thanks,
message is really in allErrors :)

but in my opinion, form should be sent through input select is empty :)