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.

build checkbox dynamic

  1. ovedmo
    Member

    need to build diffrent chackboxs for each category, i try this code (just for test).

    foreach($form["fields"] as &$field)
    switch($field["id"])
    {
    case "5":
    $field['inputs']=array();
    $a = array( 'id' => '5.1',
    'label' => 'test',
    'name' => '',
    );
    $field['inputs'][] = $a;
    break;
    }

    but it is not working, the array date changed but no effect on display!!

    Posted 9 years ago on Wednesday August 25, 2010 | Permalink
  2. I'm not sure what you are trying to do. What do you mean you are trying to build different checkboxes for each category? Please explain what you are trying to accomplish in more detail.

    Posted 9 years ago on Wednesday August 25, 2010 | Permalink
  3. ovedmo
    Member

    i will give an example.
    i want the same form to be diffrent by variable that give the number of checkboxes.
    need a way to build form checkbox dynamicly.

    Posted 9 years ago on Thursday August 26, 2010 | Permalink
  4. ovedmo
    Member

    can any one help me??

    Posted 9 years ago on Monday August 30, 2010 | Permalink
  5. In order to populate fields dynamically, such as checkboxes, you have to use our available API hooks to do so. Judging from the code above, you aren't doing so. Do a search on the forums for "dynamic population", "dynamically populate field", etc. and there are numerous threads on this subject.

    Posted 9 years ago on Monday August 30, 2010 | Permalink