![]() |
Checkboxes problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Checkboxes problem (/showthread.php?tid=31221) |
Checkboxes problem - El Forum - 06-10-2010 [eluser]variouspixels[/eluser] I had a fully working form till I tried adding some checkboxes. The checkbox field is required and does display errors if unchecked but previously checked checkboxes are not saved when I get an error anywhere else on the form. I have played around with a few codeigniter functions (form_checkbox, set_value(options[])) but I am not having any success. Code: //View: Code: // Controller many thanks gemmes Checkboxes problem - El Forum - 06-10-2010 [eluser]Ivar89[/eluser] I am not sure but I thought you also had: Code: set_checkbox() Checkboxes problem - El Forum - 06-10-2010 [eluser]Ivar89[/eluser] You can also save the vars in your session data before validation. Checkboxes problem - El Forum - 06-10-2010 [eluser]variouspixels[/eluser] grr... I swear thats the first thing I tried. Anyway, many thanks. Checkboxes problem - El Forum - 06-10-2010 [eluser]Ivar89[/eluser] Ohw lol, I'm srry if you google it you will get to see forums threats similar to this which might give you a better look because to be honoust I am a beginner to with CI so ![]() Checkboxes problem - El Forum - 06-10-2010 [eluser]variouspixels[/eluser] It does not matter if your a beginner, set_checkbox worked fine. Thanks. I did google and search this forum but I think other people had more complicated script problems. I probably had a typo and assumed that it was some misunderstanding of Codeigniter. Checkboxes problem - El Forum - 06-10-2010 [eluser]Ivar89[/eluser] ok^^ glad to help ![]() Checkboxes problem - El Forum - 07-14-2010 [eluser]helloworldly[/eluser] Hello, I am having the same issue. What was your solution exactly? I'm using CI's form validation. I'm having an issue of getting set_checkbox() working when using multiple checkboxes as an array. Code: // more code And Code: <input type="checkbox" value="XYZ" name="group[]" <?php echo $this->validation->set_checkbox('group', 'XYZ'); ?> /> Thanks for any help. Checkboxes problem - El Forum - 07-15-2010 [eluser]variouspixels[/eluser] Here is some of my code, seems similar to yours. view: Code: <strong class="field"> Code: $this->form_validation->set_rules('interests[]', 'Checkboxes', 'required'); // Interest Checkbox Required working |