![]() |
how to process a form with multiple checkboxes? - 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: how to process a form with multiple checkboxes? (/showthread.php?tid=40332) |
how to process a form with multiple checkboxes? - El Forum - 04-05-2011 [eluser]k2zs[/eluser] I am working on a form where the user will select multiple checkboxes with the same name. The values will be unique ID's from another table. I want to loop through all the checkboxex and insert into a record table. My form is built like this: Code: if($subquery->num_rows()>0){ and in my controller I am only looping through the post data to see if it is working. Here is my controller function: Code: function submit() and when I set enable_profiler to "TRUE" I see that the array is posted correctly: Code: $_POST['plId'] = but if I just loop through the post data and echo the values I only get the first digit of the data in the array. What am I doing wrong? I would eventually like to replace my echoe'd output with an insert into the database. I am using CI v2.0 how to process a form with multiple checkboxes? - El Forum - 04-05-2011 [eluser]wh1tel1te[/eluser] Code: function submit() how to process a form with multiple checkboxes? - El Forum - 04-10-2011 [eluser]k2zs[/eluser] Sorry I didn't reply but you solved my issue and I've been deep into development... ![]() Thanks for your help... |