ZF2-358: Select elements won't be selected when isValid() fails
Description
How to reproduce:
In form class:
$periodId = new Element('periodId');
$periodId->setAttributes(array (
'type' => 'select',
'id' => 'periodId',
'options' => $this->getPeriodOptions()
));
$this->add($periodId);
In view script:
echo $this->formSelect($this->form->get('periodId'));
Comments
Posted by Chris Martin (cgmartin) on 2012-07-04T21:37:22.000+0000
Was unable to reproduce using commit f8e8120f11089c2a29027fd2b26002f666eb8110 Date: Wed Jul 4 05:34:43 2012 -0700
I had set up a form with a select input and text input, both required. I triggered a "false" isValid() by not filling in the required text input, but having an option selected in the select element. The previously selected element was still selected after the form's isValid() was false.
http://cgmartin.com/caps/…
Please give some additional repro steps if this is still an issue for you, Tõnis.
Posted by Chris Martin (cgmartin) on 2012-08-07T18:05:55.000+0000
Unable to reproduce in latest trunk. Closing issue.