multiple checkbox
-
Hi all Using zend framework how to create multiple checkbox? Can any one tell me Thanks in advance, rose
If you are just looking to create multiple checkboxes you can use the same command to make 1 check box over and over until you have the number of checkboxes you want:
$ispublic = new Zend\_Form\_Element\_Checkbox('chkbox1'); $ispublic->setLabel('Check box label') ->setAttrib('id','chkbox1');
I have a feeling though, that you are looking to put radio buttons on your form. Here is an example of creating radio buttons:
$staffname = array('Jim', 'John');
$staff = new Zend_Form_Element_Radio('staff');
$staff->setRequired(true) // field required
->setValue('R') // first radio button selected
->setMultiOptions($staffname); // add array of values / labels for radio group
$form->addElement($staff);More information can be found here: http://www.davidkelly.ie/blog/2008/06/18/zend_form-radio-buttons/[^] Joe Ceresini Network Engineer jceresini@hostmysite.com Hostmysite.com