Alexey Gradoboev - 2007-01-29 13:31:30
Hello, Manuel. Thank you for you greate work and great site. Can you please help me to solve one problem. I'm trying to use multiple checkboxes. But I can't get them working.
The problem concerns functions SetCheckedRadio, SetCheckedState, SetInputValue, SetSelectOptions. I can't understand which one I should use to set values for multiple checkboxes.
--------
For example there are 3 checkboxes with one name (Pets) and different id (dogs,cats,birds), then I get values from the mysql base (from one field 'pets') as array. What function can I use to set values for checkboxes?
--------
And there is another problem. How can I create checkbox fields to look like:
<td>General Label:</td><td>[] - option1<br>[] - option2<br>[] - option3</td>
Is there an oportunity to do something like this:
$form->AddInput(array(
"TYPE"=>"checkbox",
"NAME"=>"q_advanced_search",
"ID"=>"q_advanced_search",
"MULTIPLE"=>"1",
"OPTIONS"=>("VALUE1"=>"OPTION1","VALUE2"=>"OPTION2","VALUE3"=>"OPTION3"),
"LABEL"=>General Label
));
So this field will return the example above:
<td>General Label:</td><td>[] - option1<br>[] - option2<br>[] - option3</td>
where [] - checkboxes.
Do I need to create my one class for that? If so can you give me any help notes how to realise that?