get checkbox value from POST method |
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
Maybe this will help you.
PHP: Get Values of Multiple Checked Checkboxes What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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
You can try this, you will need to fill it in. NOT TESTED!
PHP Code: foreach ($this->input->post('checkbox_name') as $checkbox) What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |