RE: Multiple selection in Forms
by "Jeff Rankin" <jrankin(at)oneil.com>
|
Date: |
Tue, 13 Feb 2001 09:25:02 -0500 |
To: |
"Alice Loftin" <aliki(at)wnm.net>, "hwg-techniques" <hwg-techniques(at)hwg.org> |
In-Reply-To: |
wnm |
|
todo: View
Thread,
Original
|
|
Alice:
I might be wrong, but if you're using a form method of "post", this
information may be passed as a comma-delimited list, so if I select "Rain
Coat" and "Underwear", it is passed through the form post as Rain
Coat,Underwear. I could be wrong about this, but typically this is how it's
worked in conjunction with Cold Fusion and ASP.
Now, once this information is passed, you need some way to parse it, and I
would typcially use some server-side language to turn it into an array, so
option[1] becomes "Rain Coat" and option[2] becomes "Underwear". Then you
could loop through the array length (which is 2) and enter each element into
your database, or whatever you need to do with it.
Hope this helps!
- Jeff
=================================
Jeff Rankin jrankin(at)oneil.com
User Interface & Web Technologies
O'Neil & Associates, Inc.
http://www.oneil.com
937.461.1602 x 3504
=================================
> -----Original Message-----
> From: owner-hwg-techniques(at)hwg.org
> [mailto:owner-hwg-techniques(at)hwg.org]On Behalf Of Alice Loftin
> Sent: Tuesday, February 13, 2001 7:47 AM
> To: hwg-techniques
> Subject: Multiple selection in Forms
>
>
> Hi,
>
> I'm trying to feed multiple selections into a database through a form
> and can't seem to make it pass more than one variable at a time.
>
> For example:
> <select name="options" multiple size=1>
> <option>Rain Coat</option>
> <option>Rain Hat</option>
> <option>Underwear</option>
> </select>
>
> While the user is able to select more than one of the options, only the
> last option selected is passed on to the database (php>postgres). I
> can't find any information on this anywhere, and I'm getting really
> frustrated. Does anyone know of a solution that doesn't require
> javascript, php, or other scripting on the form page's end?
>
> Thanks,
> -alice
>
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA