What I do is:
<input type="checkbox" name="check[]" value="Box 1">Box 1<BR> 
<input type="checkbox" name="check[]" value="Box 2">Box 2<BR> 
<input type="checkbox" name="check[]" value="Box 3">Box 3<BR> 
<input type="checkbox" name="check[]" value="Box 4">Box 4<BR> 
<input type="checkbox" name="check[]" value="Box 5">Box 5<BR>

Then in the action script you'll get an array with only the checked values named 
$checked.  So $checked[0] could be 'Box 2' and $checked[1] could be 'Box 5'.  Be aware 
if nothing is checked, then $checked won't be an array, so you'll need
to test with is_array($checked) before referencing it with, say, foreach.

> From: "Scott Saraniero" <[EMAIL PROTECTED]>
> Hi,
> 
> I have a form that has a section with multiple checkboxes. I would 
> like to be able to send the checked boxes out as an array, and be 
> able to retrieve the array in the next page (that the form variables 
> go to.) I cannot find specific info on this anywhere. Can someone 
> please point me in the right direction?
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to