ZF2-358: Select elements won't be selected when isValid() fails


How to reproduce:

In form class:

$periodId = new Element('periodId');
$periodId->setAttributes(array (
    'type' => 'select', 
    'id' => 'periodId', 
    'options' => $this->getPeriodOptions()

In view script:

echo $this->formSelect($this->form->get('periodId'));


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.…

Please give some additional repro steps if this is still an issue for you, Tõnis.

Unable to reproduce in latest trunk. Closing issue.