-
Notifications
You must be signed in to change notification settings - Fork 5
forms multi input
Harmen Janssen edited this page Jun 30, 2015
·
2 revisions
$form->addElement('multicheckbox', 'rappers', array(
'label' => 'Pick your favorite rappers:',
'multiOptions' => array(
'md' => 'Mos Def',
'tk' => 'Talib Kweli',
'gu' => 'Guru',
'mf' => 'MF DOOM'
)
));
$form->addElement('radio', 'rappers', array(
'label' => 'Pick your favorite rapper:',
'multiOptions' => array(
'md' => 'Mos Def',
'tk' => 'Talib Kweli',
'gu' => 'Guru',
'mf' => 'MF DOOM'
)
));
For sets of radiobuttons or checkboxes, prefix any option in the array with "label_" to have it resolve to a label attribute:
$form->addElement('radio', 'rappers', array(
'label' => 'Pick your favorite rapper:',
'multiOptions' => array(
'md' => 'Mos Def',
'tk' => 'Talib Kweli',
'gu' => 'Guru',
'mf' => 'MF DOOM'
),
"label_class" => "radio-label"
));
This will make the labels look like this:
<label for="mf-field" class="radio-label"><input id="rappers-field-mf">MF DOOM</label>
```