[eluser]Cristian Gilè[/eluser]
Hi WW,
to set a checkbox as checked the third parameter of form_checkbox function needs to be TRUE or FALSE like this:
Code:
echo form_checkbox('publish_entry[]', $entry['id'], TRUE);
not
Code:
echo form_checkbox('publish_entry[]', $entry['id'], 'checked="TRUE"');
When you submit the form, the post variable contains only the values of checked checkbox.
For example, if you submit a form like this:
Code:
echo form_checkbox('publish_entry[]', 1, TRUE);
echo form_checkbox('publish_entry[]', 2, FALSE);
echo form_checkbox('publish_entry[]', 3, TRUE);
the publish_entry[] array contains the first and third value but not the second. (
Code:
Array ( [0] => 1 [1] => 3 )
)