Forum Moderators: open
<html><head>
<TITLE>FormListBoxRespond.asp</TITLE>
</head><body bgcolor="#FFFFFF">
<form action="FormListBoxRespond.asp" method="post">
<SELECT NAME="state">
<OPTION SELECTED VALUE="md">Maryland</OPTION>
<OPTION value="dc">District of Columbia</OPTION>
<OPTION value="va">Virginia</OPTION>
<OPTION value="whoknows">Somewhere Else!</OPTION>
</SELECT>
<input type=submit value="Choose State">
</form>
</body></html><%mystate = request.form("state")
Select Case ucase(mystate)
case "DC"
response.write "DC meeting on 15th"
case "MD"
response.write "MD meeting on 20th"
case else
response.write "No meetings for you to attend!"
End Select%>
I suppose I would prefer to use IF statements, but i can't get that to work either!
<html><head>
<TITLE>FormListBoxRespond.asp</TITLE>
</head><body bgcolor="#FFFFFF">
<form action="FormListBoxRespond.asp" method="post">
<SELECT NAME="state">
<OPTION SELECTED VALUE="select">SELECT</OPTION>
<OPTION VALUE="md">Maryland</OPTION>
<OPTION value="dc">District of Columbia</OPTION>
<OPTION value="va">Virginia</OPTION>
<OPTION value="whoknows">Somewhere Else!</OPTION>
</SELECT>
<input type=submit value="Choose State">
</form>
</body></html> <%mystate = request.form("state")
Select Case ucase(mystate)
case "SELECT"
response.write ""
case "MD"
response.write "MD meeting on 20th"
case "DC"
response.write "DC meeting on 15th"
case else
response.write "No meetings for you to attend!"
End Select%>
The first time around there is no selection from the request.form so it will do the last (Please Select) line.
This time it works, it probably worked when I used your code last time, but I was getting a bit confused with the browser's refresh.
So thanks again, it now works!