Re: Multiple Select And Javascript Issue
| From: | David Robley | Date: | Fri, 25 Aug 2000 05:28:51 +0000 |
| Subject: | Re: Multiple Select And Javascript Issue | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13587@lists.php.net to get a copy of this message | ||
On 25 Aug, Grant Walters wrote:
>> > Scenario as follows:
>> >
>> > SELECT with MULTIPLE options is being built by Javascript code
>> that won't
>> > accept a variable name like "items[]" so it fills a field
>> called "items".
>> >
>> > This is'nt too bad as I can work around it with a hidden field.
>> >
>> > The problem is that PHP doesn't populate HTTP_POST_VARS with the entries
>> > from "items" unless they are acutally selected.
>> >
>> > Can I get PHP to return all values from the SELECT MULTIPLE variable?
>> >
>> > Regards
>> >
>> > GRANT WALTERS
>> > Walters & Associates, P O Box 13-043, Johnsonville, Wellington,
>> New Zealand
>> > Phone: +64 4 4765175 CellPhone: 025 488265
>> >
>>
>> Maybe this is relevant? http://au.php.net:81/FAQ.php/#7.14
>>
>
> The bit about the [] is. I managed to suss that one myself. My problem is
> still that PHP seems to only propagate the values if all of the values are
> selected. Or is it the Browser? not passing them.
>
> I need to obtain all the values in the select list whether they are selected
> or not.
>
> Regards
It's not so much that PHP propagates them as they are only sent if set.
The data might well come from a form that is pure html and not parsed by
php. If you need the values of all the options, you may need to pass
them another way - hidden field, perhaps or could you keep them in a
database and do a lookup as required?
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA