Question
pass drop down value to url
Hi,
I have a dynamically created drop down box. I want to pass the selected value in the box to the URL, I'm stumped how to do this ? should I use js or can I do it without. I have the box in a form with a button. code below:
<code>
<form id="form1" name="form1" method="post" action="mainPage.asp">
<label for="select"></label>
<select name="select" id="select">
<%
While (NOT rsCategory.EOF)
%>
<option value="<%=(rsCategory.Fields.Item("category_id").Value)%>"><%=(rsCategory.Fields.Item("category_name").Value)%></option>
<%
rsCategory.MoveNext()
Wend
If (rsCategory.CursorType > 0) Then
rsCategory.MoveFirst
Else
rsCategory.Requery
End If
%>
</select>
</p>
<label for="Submit"></label>
<input type="submit" name="Submit" value="Display Products in this Category" id="Submit" />
</form>
</code>
I just want to ass the drop down/select value to the URL and post back to the same page for a recordset to collect the value and display the specified results.
Appreciate any feedback.
I have a dynamically created drop down box. I want to pass the selected value in the box to the URL, I'm stumped how to do this ? should I use js or can I do it without. I have the box in a form with a button. code below:
<code>
<form id="form1" name="form1" method="post" action="mainPage.asp">
<label for="select"></label>
<select name="select" id="select">
<%
While (NOT rsCategory.EOF)
%>
<option value="<%=(rsCategory.Fields.Item("category_id").Value)%>"><%=(rsCategory.Fields.Item("category_name").Value)%></option>
<%
rsCategory.MoveNext()
Wend
If (rsCategory.CursorType > 0) Then
rsCategory.MoveFirst
Else
rsCategory.Requery
End If
%>
</select>
</p>
<label for="Submit"></label>
<input type="submit" name="Submit" value="Display Products in this Category" id="Submit" />
</form>
</code>
I just want to ass the drop down/select value to the URL and post back to the same page for a recordset to collect the value and display the specified results.
Appreciate any feedback.
