CodeIgniter Forums
Database Checkbox in validation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Database Checkbox in validation (/showthread.php?tid=10864)



Database Checkbox in validation - El Forum - 08-15-2008

[eluser]Yash[/eluser]
Hi,

I need to populate a checkbox list from database. and load as per list in database.Achieved.

I've problem once it populate and user submit with some error now I need to remember this list and load.

I've tried validation.Not effective I feel.

Any idea?


Database Checkbox in validation - El Forum - 08-15-2008

[eluser]Seppo[/eluser]
In pseudo code it would be something like this
if ((form was submitted && this was checked) || (form was not submitted and this was checked on db)) echo ' checked="checked"';

you can use the form usbmit button to check if it was submitted.