Skip to main content

Keep form values after page reload - Codeigniter



How can I keep checkboxes selected after the form has been submitted? I found the set_checkbox function in the Codeigniter User Guide, but it doesn't work.





Form field code from the User Guide







<input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> />

<input type="checkbox" name="mycheck" value="2" <?php echo set_checkbox('mycheck', '2'); ?> />







I also googled this and found a couple of workarounds, but they were based on previous versions of Codeigniter. And they were based on Form Validation, which isn't necessary for my form, because none of the fields are required.





How can I retain the checkbox field value after the form is submitted?





UPDATE : This question is not about form validation and errors. I want to retain the checkbox field value AFTER the page is reloaded. Is jquery a possibility?


Comments

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?