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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't read data from listbox

Status
Not open for further replies.

mihalych

Programmer
Jul 24, 2003
27
US
What is the correct way to get value from list box using server-side scripting? As Request.form("listbox") does not work.
 
Your listbox (SELECT) needs to have a name:
<SELECT NAME=&quot;listbox1&quot;>
<option value=&quot;myDesiredValue&quot;>What I want the user to see</option>
</select>

Then to retrieve the value after the form has been submitted:
<%
MyListboxValue = request.form(&quot;listbox1&quot;)
response.write(MyListboxValue) 'verify that you got what you wanted
%>
 
Everything is working well. When I resubmit the page to itself, the first list box displays the first item, but how could it display the item that was selected before?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top