faqts : Computers : Programming : Languages : Asp : ASP/VBScript : Common Problems : forms and user input

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

24 of 36 people (67%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

How do I retrieve the values of items in a SELECT MULTIPLE list with the post method in ASP?

Aug 22nd, 2001 10:27
Stuart Whitmore, Daniel Barnes,


Step through the collection in a loop.  For example, if
your form field name is Planets and the user selected Mars,
Jupiter, and Pluto, the following code would provide the
output shown (although the order of the selected items
may not be as shown -- I haven't tested that).
CODE:
-----
Response.Write("Your tour will include the following planets:<br>"
For Each Planet in Request.Form("Planets")
  Response.Write(Planet & "<br>")
Next
OUTPUT:
-------
Your tour will include the following planets:
Mars
Jupiter
Pluto



© 1999-2004 Synop Pty Ltd