Wrox Home  
Search P2P Archive for: Go

  Return to Index  

html_code_clinic thread: question regarding the select element used in html forms


Message #1 by "Rowena Perks" <Rowenap@w...> on Tue, 21 Nov 2000 12:48:06 -0000
Hi Jim,
I hope u r not just doing Request.querystring("test") as that will just give
u the one value...u have to run a loop for the selected items..and then
extract those values  in some local variables or session variables as per
your requirement.


-----Original Message-----
From: Gregory_Griffiths@c...
[mailto:Gregory_Griffiths@c...]
Sent: 21 November, 2000 9:24 AM
To: HTML Code Clinic
Subject: [html_code_clinic] RE: question regarding the select element
used in html forms


Jim,
	I believe that your problem is with the script that you are 
submitting to handling the data, as you said it only uses the last 
values, so I think we can assume the following is occuring :

1. You pass test=123 and test=456 and test=789 to the code
2. First pass, the value of the test is set to 123
3. First pass, the value of the test is set to 456
4. First pass, the value of the test is set to 789

Thus, you are returned 789. I would therefore suggest that you look at 
the script that you are submitting this to and either recode it to 
handle multiples or post it to the correct mailing list / newsgroup for 
assistance.

> -----Original Message-----
> From: Rowenap@w... [mailto:Rowenap@w...]
> Sent: 21 November 2000 12:48
> To: html_code_clinic@p...
> Subject: [html_code_clinic] question regarding the select element used
> in html forms
> 
> 
> -----Original Message-----
> From: Jim Duncan [mailto:jduncan@c...]
> Sent: 21 November 2000 02:36
> To: support@w...
> Subject: Instant HTML 4.0 1-56-8
> 
> 
> I have a question regarding the select element used in html 
> forms. I am
> unable to successfully  pass multiple selected values.
> When i try to pass multiple selected values the name value 
> pair for the
> select element only contains the value for the last selected 
> value. What
> can I do?
> 
> example of multiple select element:
> <form action="super.html" method=get>
>     <select name="test" multiple size=3>
>         <option value="01">test 1</option><br>
>         <option value="02">test 2</option><br>
>         <option value="03">test 3</option><br>
>     </select><br>
>     <br>
>     <input type=submit><br>
> </form>
> 
> url query string when test 1 and test 2 are selected:
> super.html?test=01&test=02
> 
> the value of test on the page the form submits to(super.html) is 02
> 
> 

  Return to Index