[eluser]Unknown[/eluser]
Hi everyone,
I'll admit up-front that I'm very new to CodeIgniter.
I'm creating a set of checkboxes in my PyroCMS admin page using CodeIgniter's form_checkbox and set_checkbox functions:
Code:
<?php echo form_checkbox('purpose_e', '1', set_checkbox('purpose_e', '1')); ?> Environmental
<?php echo form_checkbox('purpose_f', '1', set_checkbox('purpose_f', '1')); ?> Flood
<?php echo form_checkbox('purpose_g', '1', set_checkbox('purpose_g', '1')); ?> Groundwater
<?php echo form_checkbox('purpose_h', '1', set_checkbox('purpose_h', '1')); ?> Hydropower
<?php echo form_checkbox('purpose_i', '1', set_checkbox('purpose_i', '1')); ?> Irrigation
<?php echo form_checkbox('purpose_n', '1', set_checkbox('purpose_n', '1')); ?> Navigation
<?php echo form_checkbox('purpose_p', '1', set_checkbox('purpose_p', '1')); ?> Pollution
Everything seems to work fine, the page executes and the relevant 1 values are written to the database fields, but when I edit the entry the relevant checkboxes aren't being rechecked, I just get a set of blank unchecked boxes.
Is there some elementary mistake I'm making?
Thanks in advance for any help,
Tony.