Jump to content

PHP retrieving checkboxes values:


chelnov63

Recommended Posts

hi an excerpt from my form is something like this:

 

<input name="send[]" type="checkbox" id="send[]" value="10"; />
<input name="send[]" type="checkbox" id="send[]" value="12"; />
<input name="send[]" type="checkbox" id="send[]" value="16"; />
<input name="send[]" type="checkbox" id="send[]" value="17"; />
<input name="send[]" type="checkbox" id="send[]" value="14"; />

 

excerpt from the php file is:

 

$send = $_POST["send"];
$sendIndexes= array();
$i = 0;

foreach ($send as $key)
{
 $sendIndexes[$i] = "$key";
 $i++;
}

 

The above puts the checked checkbox values into an array. However I want to do the opposite i.e put the unchecked checkboxes values into an array.

 

Is this possible..thanks in advance..

 

Link to comment
https://forums.phpfreaks.com/topic/155048-php-retrieving-checkboxes-values/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.