re: Checkbox Groups in External Form?
Permalink
Hi guys,
Just wondering if this is at all possible? I have been using the form helper to output a checkbox group but I can not change the id's.
Below is the code I have been using:
Any advice would be greatly appreciated.
cheers,
Ritch
Just wondering if this is at all possible? I have been using the form helper to output a checkbox group but I can not change the id's.
Below is the code I have been using:
$products = array('Standard Bubble','Lamination', 'Protective Bags', 'Insulation', 'Enviro Range', 'Special'); for ($n = 0; $n < count($products); $n++) { print '<dd>'.$form->checkbox('product[]', $products[$n], false, array('id' => 'selected' . $n)).'<label for="chkbx'.$n.'">'.$products[$n].'</dd>'; }
Any advice would be greatly appreciated.
cheers,
Ritch
The C5 form helper outputs the same ID as name so you can't override it.
You could however modify the helper and disable this.
Oliver