Reputation: 909
I need an array of check-box that should look like as following:
<input type="checkbox" name="myname[]" >
Currently I am using
new Zend_Form_Element_Checkbox('myname[]');
but it doesn't show the array in html control. It draw this as
<input type="checkbox" name="myname">
AnySolution?
Upvotes: 4
Views: 3405
Reputation: 11978
<?php
$myname = new Zend_Form_Element_Checkbox('myname');
$myname->setLabel('This is my label')
->setRequired(true)
->addMultiOptions(array('myname' => true));
Upvotes: 2