[eluser]Unknown[/eluser]
What in the world am I doing wrong?! Following the user guide... when there are validation errors none of the check boxes repopulate... I am new to CI and just trying out the form validation class, tinkered with it for hours and exhausted every possibility, it is probably something simple that will make me look like a dufus.. but whatever just want it to work...
here is my controller code for checkboxes...
Code:
#Checkbox attributes
$data['first_option'] = array('name' => 'seminar[]', 'id' => 'Option_1', 'value' => '1', 'checked' => FALSE);
$data['second_option'] = array('name' => 'seminar[]', 'id' => 'Option_2', 'value' => '2', 'checked' => FALSE);
$data['third_option'] = array('name' => 'seminar[]', 'id' => 'Option_3', 'value' => '3', 'checked' => FALSE);
$data['fourth_option'] = array('name' => 'seminar[]', 'id' => 'Option_4', 'value' => '4', 'checked' => FALSE);
Here is what it is in the view
Code:
<p><?php echo form_checkbox($first_option, set_checkbox('seminar', '1')); ?> <label for="first_option">Option 1</label></p>
<p><?php echo form_checkbox($second_option, set_checkbox('seminar', '2')); ?> <label for="second_option">Option 2</label></p>
<p><?php echo form_checkbox($third_option, set_checkbox('seminar', '3')); ?> <label for="third_option">Option 3</label></p>
<p><?php echo form_checkbox($fourth_option, set_checkbox('seminar', '4')); ?> <label for="fourth_option">Option 4</label></p>
anyone see any red flags? I have input fields and the set_value() is working just fine. Just cant seem to get it working with checkboxes...