• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get checkbox value from POST method

#1
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
Reply

#2
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 )
Reply

#3
(07-31-2018, 07:50 AM)InsiteFX Wrote: Maybe this will help you.

PHP: Get Values of Multiple Checked Checkboxes

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
Reply

#4
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 )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.