Re: Multiple Select And Javascript Issue

From: Date: Fri, 25 Aug 2000 05:34:56 +0000
Subject: Re: Multiple Select And Javascript Issue
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-13589@lists.php.net to get a copy of this message
I don't think PHP has anything to do with the form values being sent, it's just the browser that doesn't send them. I'd say the option mentioned below of using a hidden field and an array to pass the values on to PHP. - mic ----- Original Message ----- From: "David Robley" <huntsman@www.nisu.flinders.edu.au> To: <Grant.Walters@walters.co.nz> Cc: <php-general@lists.php.net> Sent: Friday, August 25, 2000 3:28 PM Subject: Re: [PHP] Multiple Select And Javascript Issue > 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 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#13589) next »