ZF-7317: Faulty code in form.standardElements


at:… 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',
        '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.


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.

/me here again... I spoke too soon. the above code does NOT work, I forgot to clean the URL

Patch added. (includes: De, En, Es, Fr, Ja, Zh)

Fixed in trunk r24835