zend form multicheckboxes naming

Posted by neziric on Stack Overflow See other posts from Stack Overflow or by neziric
Published on 2010-04-12T11:11:18Z Indexed on 2010/04/12 11:13 UTC
Read the original article Hit count: 162

Filed under:
|

how do i have to nest multicheckboxes so that they are named like this 'foo[]['bar']' .

i've used subforms but they give me naming like this 'foo[bar][]'.

my code:

$sub = new Zend_Form_SubForm('sub');

$wish = new Zend_Form_Element_MultiCheckbox('bar');

$wish

->setMultiOptions($education_direction->getAll())
->setLabel('Wish')    
->setRequired(true);

$sub->addElements(array( $wish ));

$this->addSubForm($sub, 'foo');

© Stack Overflow or respective owner

Related posts about zf

Related posts about php