Set Checked on checkbox array |
[eluser]Ghetolobster[/eluser]
Hi there, I am having some difficulty with setting the checkbox after validation occurs. I currently have my check-boxes setup as the following(no validation runs on the check-boxes themselves): Code: <label for="yellow">Yellow</label><input id="yellow" name="includes[]" value="yellow" type="checkbox" <?php echo set_checkbox('includes[]','yellow'); ?> /> Now when the validation runs nothing occurs with the check-boxes. So how would I go about resolving this matter? All advise is greatly appreciated. Regards,
[eluser]PhilTem[/eluser]
According to http://ellislab.com/codeigniter/user-gui...ysasfields I think it should be Code: <input id="green" name="includes[]" value="green" type="checkbox" <?php echo set_checkbox("includes['green']", FALSE); ?> /> and for the other colors respectively. But I can't tell for sure since I don't do that stuff manually (I tend to using CI's form helper for that rare occasions where I have multiple checkboxes for one post-variable)
[eluser]Ghetolobster[/eluser]
[quote author="PhilTem" date="1339515045"]According to http://ellislab.com/codeigniter/user-gui...ysasfields I think it should be Code: <input id="green" name="includes[]" value="green" type="checkbox" <?php echo set_checkbox("includes['green']", FALSE); ?> /> and for the other colors respectively. But I can't tell for sure since I don't do that stuff manually (I tend to using CI's form helper for that rare occasions where I have multiple checkboxes for one post-variable)[/quote] How would you set it up using the form helper? |
Welcome Guest, Not a member yet? Register Sign In |