Can anyone tell me where i'm going wrong with this code:
<SELECT NAME="day">
<%For i = 1 to 31
d_options = d_options & "<option"
If Request.QueryString("day") = i then
If Request.QueryString("day") > "28" and Request.QueryString("month") = "2" and Request.QueryString("year") <> "2008" Then
d_options = d_options & " selected>" & "28" & "</option>"
ElseIf Request.QueryString("day") > "29" and Request.QueryString("month") = "2" and Request.QueryString("year") = "2008" Then
d_options = d_options & " selected>" & "29" & "</option>"
Else d_options = d_options & " selected>" & Request.QueryString("day") & "</option>"
End if
Else
d_options = d_options & ">" & i & "</option>"
End if
Next
Response.Write d_options
%>
</SELECT>
I'm getting a list of numbers 1 to 31, but it's not adding SELECTED to the option tag when it should.
Thanks.
<SELECT NAME="day">
<%For i = 1 to 31
d_options = d_options & "<option"
If Request.QueryString("day") = i then
If Request.QueryString("day") > "28" and Request.QueryString("month") = "2" and Request.QueryString("year") <> "2008" Then
d_options = d_options & " selected>" & "28" & "</option>"
ElseIf Request.QueryString("day") > "29" and Request.QueryString("month") = "2" and Request.QueryString("year") = "2008" Then
d_options = d_options & " selected>" & "29" & "</option>"
Else d_options = d_options & " selected>" & Request.QueryString("day") & "</option>"
End if
Else
d_options = d_options & ">" & i & "</option>"
End if
Next
Response.Write d_options
%>
</SELECT>
I'm getting a list of numbers 1 to 31, but it's not adding SELECTED to the option tag when it should.
Thanks.