How to validate a Checkbox form in Codeigniter and re-populate checked - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: How to validate a Checkbox form in Codeigniter and re-populate checked (/showthread.php?tid=56991) |
How to validate a Checkbox form in Codeigniter and re-populate checked - El Forum - 02-05-2013 [eluser]egguzel[/eluser] Obivously, I have 2 problems. When I submit a checkbox form which is an array value and non-cheched form, It doesn't show me validation error such as 'this field is required'. It shows error when I check one of them. Normally it should have shown me even though I don't check anything on the form and just press submit. How can I repopulate a checkbox as checked when I submit as checked. Think like set_value. In set_value it populates previous data. At this I want it to be auto checked when if I had submitted. My controller Code: function preferences() { My view: Code: <div>Days to Deliver</div> How to validate a Checkbox form in Codeigniter and re-populate checked - El Forum - 02-10-2013 [eluser]rjsmith[/eluser] To reset the checkbox values, try set_checkbox(). As for the validator issues you're having, I'd suggest manual validation for the cases the validator doesn't catch. |