Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting display value from select list

Status
Not open for further replies.

dokken

Programmer
Mar 7, 2001
61
US
In the following select list, using response.form, how do I get the display value from the list? response.Form("lstItems") gives me 1, or 2. I want First or Second.

<select 'lstItems'>
<option value='1'>First</option>
<option value='2'>second</option>
</select>
 
Hi

The select box needs to be in a form with a submit button and an &quot;action&quot; page.

When the user presses submit the form value &quot;lstItems&quot; will be passed to the next page.

On the next page (which must be an ASP page) you can call the value from the list box by using:

Code:
<%=Request.form(&quot;lstItems&quot;)%>

That is it! Remember that these scripts are run on the server so &quot;request&quot; is asking what the user has submitted and &quot;response&quot; is what is being sent back to the browser. Derren
[The only person in the world to like Word]
 
Bugger - I spent ages trying to work out what was being asked and I still didn't read it right! Pants

[glasses]
Derren
[The only person in the world to like Word]
 
I'm pretty sure that <%=Request.form(&quot;lstItems&quot;)%>
will give me the contents of the Value, not the text displayed to the user. i.e. 1 instead of First
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top