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

How to refer a item in combo box in ASP?

Status
Not open for further replies.

longmatch

Programmer
Nov 1, 2001
406
I would like to run a query based upon selection in a combo box in my ASP page. How can I refer the item user has selected?

Thanks

Haijun
 
Let's say combo box items are like this:

<select name=myCombo>
<option value=1>First
<option value=2>Second
</select>

When you submit this in a form, you can request it by its name and use it whereever you want which is something like
<%
selectedOption = request.form(&quot;myCombo&quot;)
SQL = &quot;SELECT * FROM tbl WHERE ID = &quot; & selectedOption
' selectedOption is either &quot;1&quot; or &quot;2&quot; in this example
%>
 
My problem was solved under your help.

Thanks


Haijun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top