Checkboxs and array indices
From: Nik Coughin (nrkn!no-spam!_at_woosh.co.nz)
Date: 12/22/04
- Next message: Nik Coughin: "Re: Checkboxs and array indices"
- Previous message: Smitro: "Re: PHP to Doc"
- Next in thread: Nik Coughin: "Re: Checkboxs and array indices"
- Reply: Nik Coughin: "Re: Checkboxs and array indices"
- Reply: Chris Hope: "Re: Checkboxs and array indices"
- Reply: Dani CS: "Re: Checkboxs and array indices"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 22 Dec 2004 17:19:19 +1300
I am having a problem with checkboxes...
I have a number of blocks like this on my form:
<input type="text" name="name[]" value="a name">
<input type="text" name="ddi[]" value="1234">
<input type="checkbox" name="delete[]">
If I then submit the form, the array $delete is the only one which isn't
indexed by its order on the form.
For example, $name[ 0 ] and $ddi[ 0 ] always return the value of the first
name[] and ddi[] input on the form.
If I check any one of the checkboxes, say the third one, then $delete[ 0 ]
will be "on", and all of the other including $delete[ 2 ] will be off.
If I checked the third and seventh checkbox, just as an example, $delete[
0 ] and $delete[ 1 ] will be "on".
So, there is no way I can tell which checkboxes are actually checked, just
how many have been checked. This is extremely annoying and doesn't happen
with any of the other form controls. Any ideas?
-- "Come to think of it, there are already a million monkeys on a million typewriters, and the Usenet is NOTHING like Shakespeare!" - Blair Houghton -=-=-=-=-=-=-=-=-=-=-=- http://www.nrkn.com/ -=-=-=-=-=-=-=-=-=-=-=-
- Next message: Nik Coughin: "Re: Checkboxs and array indices"
- Previous message: Smitro: "Re: PHP to Doc"
- Next in thread: Nik Coughin: "Re: Checkboxs and array indices"
- Reply: Nik Coughin: "Re: Checkboxs and array indices"
- Reply: Chris Hope: "Re: Checkboxs and array indices"
- Reply: Dani CS: "Re: Checkboxs and array indices"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|