I use Zend Form to create a multicheckbox field. 

For the elements in the field I use an array $data 

Now,I would also like to set the "id" of each element with individual
values. However, I am completely stuck with this. I tried to pass an array
of ids (checkboxid0,checkboxid1 and so on) but that does not work. I can
pass one id value, which is given to the first element (as per the code
below), but how do I set the individual values of each id? In ZF1 this was
easy to do (and I relied on this), but I can not get this going in ZF2.

Help is appreciated

This is the code snippet which works, which sits in a class which extends
the Form Class. The code creates the multicheckbox form, but only gives me
one id (for the first element). 


$this->add(array(
                        'name' => 'checkboxes',
                        'type' => 'multicheckbox',
                        'options' => array(
                                        'label' => 'Checkbox',
                                        'value_options' => $data),
                        'attributes'=>array(
                                        'id'=>'checboxid0'
                        )
         ));







--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Zend-Form-Setting-id-for-multicheckbox-fields-tp4660545.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to