Dan,
NO matter how I try your code it does not work, my code is below:
<%
dim Order
Order = Request("menu")
Response.Write ("<select name=""menu"" size=""2"">" & VbCr & "<option")
if selected = "ans1" then
Response.Write ("Order")
end if
Response.Write (">ans1</option>" & VbCr)
' Do this for each option
Response.Write ("</select>" & VbCr)
%>
<%
dim Order
Order = Request("menu")
Response.Write ("<select name=""menu"" size=""2"">" & VbCr & "<option")
if selected = "ans2" then
Response.Write ("Order")
end if
Response.Write (">ans2</option>" & VbCr)
' Do this for each option
Response.Write ("</select>" & VbCr)
%>
<%
dim Order
Order = Request("menu")
Response.Write ("<select name=""menu"" size=""2"">" & VbCr & "<option")
if selected = "ans3" then
Response.Write ("Order")
end if
Response.Write (">ans3</option>" & VbCr)
' Do this for each option
Response.Write ("</select>" & VbCr)
%>
<%
dim Order
Order = Request("menu")
Response.Write ("<select name=""menu"" size=""2"">" & VbCr & "<option")
if selected = "ans4" then
Response.Write ("Order")
end if
Response.Write (">ans4</option>" & VbCr)
' Do this for each option
Response.Write ("</select>" & VbCr)
%>
John316
Quote:
Originally posted by pickledAvenger
I'm asuming that you want the selected values to stay selected after the page has been submited.
You will need to pass the entered form/info back to this page, either as a query string or a form.
Use Response.Write to display your select box, this way you can control what will be written.
So you will have somthing like:
dim selected
selected = Request("menu")
Response.Write ("<select name=""menu"" size=""2"">" & VbCr & "<option")
if selected = "ans1" then
Response.Write (" selected")
end if
Response.Write (">ans1</option>" & VbCr)
' Do this for each option
Response.Write ("</select>" & VbCr)
This will make the selected option chosen after submit provided the form was posted to this page (if you have been redirected to this page after submitting to another you will need to pass this info on to the page with the drop down menu). This will only hold the info when the page is refreshed after the info has been submited once.
Hope this is kind of what you're after
Dan
|