I have dynamically created a set of checkboxes using the 'choices' item of the field. In the UI I only have a single checkbox that I applied a number of new items to it however I am unable to fetch any data from the field other than the first checkbox e.g '10.1' and not '10.2....'
This is the function I use to populate the checkboxes.
public function GFAddCheckBoxes(&$field,$cssclass,$choices)
{
//look for the select
if ($field['type'] == 'checkbox' && strpos($field['cssClass'],$cssclass) !==false)
{
$inputs = array();
for($i = 1; $i<=count($choices); $i++)
{
$choice = $choices[$i-1];
$field_id = $field['id'].".".$i;
$label = $choice['text'];
array_push($inputs,array("label"=>$label,"id"=>$field_id));
}
$field['choices'] = $choices;
$field['inputs'] = $inputs;
}
}
The functions works as I expect as I see multiple checkboxes in my form but I am unable to fetch all the result values from them. I can see this more clearly when I do a var_dump of the form and can only see the first checkbox.
Regards