Support

Account

Home Forums Front-end Issues How to get the label and value of checkbox ? Reply To: How to get the label and value of checkbox ?

  • If you want to list all options then just loop through $field['choices']

    
    foreach ($field['choices'] as $choice_value => $choice_label) {
      echo $choice_label,': ';
      if (in_array($choice_value, $value)) {
        echo 'Selected';
      } else {
        echo 'Not Selected';
      }
    }