![]() |
get checkbox value from POST method - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: get checkbox value from POST method (/showthread.php?tid=71305) |
get checkbox value from POST method - kvanaraj - 07-30-2018 I am using two dimensional array of checkbox value insert into my table. name="friend_id[]" => This method getting POST values from the form. name=<?php echo $row1['markid'];?> => This method getting select all checkbox I ll try name="friend_id[<?php echo $row1['markid'];?>]" but not working select all checkbox. select all checkbox **************** <script language="JavaScript"> function toggle(source, markid) { checkboxes = document.getElementsByName(markid); for(var i=0, n=checkboxes.length;i<n;i++) { checkboxes[i].checked = source.checked; } } </script> How to solve this? any help RE: get checkbox value from POST method - InsiteFX - 07-31-2018 Maybe this will help you. PHP: Get Values of Multiple Checked Checkboxes RE: get checkbox value from POST method - kvanaraj - 07-31-2018 (07-31-2018, 06:50 AM)InsiteFX Wrote: Maybe this will help you. My problem is when i using name=friend_id[] this can only be get the POST values. any alternate solution to get the checkbox value like $this->input->post('**********')); this only i am asking RE: get checkbox value from POST method - InsiteFX - 08-01-2018 You can try this, you will need to fill it in. NOT TESTED! PHP Code: foreach ($this->input->post('checkbox_name') as $checkbox) |