ZF-3985: Unable to validate select elements that contain optgroups
Description
Zend_Form_Element_Select supports option groups, but the default validator (InArray) is not given the correct values to test for.
<?php $form = new Zend_Form(); $form->setMethod('post'); $form->addElement($form->createElement('select', 'profession') ->setLabel('Profession') ->setMultiOptions(array( 'Technology' => array( '1' => 'Web Developer', '2' => 'Software Engineer' ) )) ); $form->addElement($form->createElement('submit', 'submit') ->setLabel("Submit") ); $fakePostData = array('profession' => '1'); $form->isValid($fakePostData); // Not valid ?>
Comments
Posted by Ralph Schindler (ralph) on 2008-11-08T06:16:52.000+0000
assigned
Posted by Thomas Corthals (turboke) on 2008-11-10T12:45:38.000+0000
Bugfix for this issue with relevant unit tests (result of bughunt day)
Posted by Thomas Weidner (thomas) on 2008-11-10T13:02:36.000+0000
Fixed with r12527. Thanks for the fix.
Posted by Wil Sinclair (wil) on 2008-11-13T14:10:05.000+0000
Changing issues in preparation for the 1.7.0 release.