PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Bug found in dynamically creating check boxes

  1. 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

    Posted 8 years ago on Thursday January 12, 2012 | Permalink