Re: multi select list and checkbox problem
| From: | Drew Kime | Date: | Tue, 06 Jun 2000 17:10:38 +0000 |
| Subject: | Re: multi select list and checkbox problem | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-251@lists.php.net to get a copy of this message | ||
> I am having a problem getting PHP3 to pass more than one selection from a mutli-list or
> checkbox....all it does is give the last entry that is selected.... is this a version problem is
> there a work around or is the problem between the chair and the keyboard ?
If you name the field as an array with a blank index, it will pass in all the values to the index.
<select name="value[]" size="3" multiple>
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select>
You will end up with:
value[0]=1
value[1]=2
value[2]=3
Double check whether it starts at key=0 or key=1, I can't remember off the top of my head.