ZF-7317: Faulty code in form.standardElements
Description
at: http://zendframework.com/manual/en/… example code is fault ( the ; after the multiOptions Array )
$element = new Zend_Form_Element_MultiCheckbox('foo', array( 'multiOptions' => array( 'foo' => 'Foo Option', 'bar' => 'Bar Option', 'baz' => 'Baz Option', 'bat' => 'Bat Option', ); ));
$element->setValue(array('bar', 'bat'));
However, described behaviour does not work either; e.g.:
$element = new Zend_Form_Element_MultiCheckbox('mode',
array(
'multiOptions' => array(
'keyword' => 'Search keywords',
'comment' => 'Search comments'
),
'value' => array('keyword'),
));
The "keyword" option is never checked. Additionally doing this:
$element->setValue( array('keyword', 'comment') );
Will not result in the appropriate input elements becomming checked. Could not find any pointer in the docus on how to make this work...?
Zend Framework 1.8.3 Release (r15950). Released on June 09, 2009.
Comments
Posted by Matthijs van Henten (mvhwaag) on 2009-07-20T03:24:33.000+0000
It seems the example code ( when fixed ) DOES work as described in the manual when using 1.8.4
I have mistakenly downloaded 1.8.3 - maybe this should be fixed on the Zend download site.
Posted by Matthijs van Henten (mvhwaag) on 2009-07-20T03:27:51.000+0000
/me here again... I spoke too soon. the above code does NOT work, I forgot to clean the URL
Posted by Frank Brückner (frosch) on 2012-05-04T09:09:48.000+0000
Patch added. (includes: De, En, Es, Fr, Ja, Zh)
Posted by Adam Lundrigan (adamlundrigan) on 2012-05-30T13:59:38.000+0000
Fixed in trunk r24835