I have a problem re-dialing a set of checkboxes after an unsuccessful validation of the form returns the user back to the same form. Drop-down menus and text inputs can be classified, but not flags!
Here is a snippet of code for the flags:
<td> <?php echo form_checkbox('ambience[]', 'casual', set_checkbox('ambience[]', 'casual')); ?> Casual <br /> <?php echo form_checkbox('ambience[]', 'romantic', set_checkbox('ambience[]', 'romantic')); ?> Romantic <br /> <?php echo form_checkbox('ambience[]', 'outdoor', set_checkbox('ambience[]')); ?> Outdoor / Alfresco <br /> <?php echo form_checkbox('ambience[]', 'trendy', set_checkbox('ambience[]')); ?> Hip & Trendy <br /> <?php echo form_checkbox('ambience[]', 'vibrant', set_checkbox('ambience[]')); ?> Vibrant <br /> <?php echo form_checkbox('ambience[]', 'up_scale', set_checkbox('ambience[]')); ?> Upscale <br /> </td>
A snippet of code for entering text that is successfully populated:
<?php echo form_dropdown('price_range', $options, set_value('price_range')); ?>
Any ideas? I'm really confused why set_checkbox doesn't work as advertised.
Nyxynyx
source share