|
-
Aug 30th, 2000, 03:57 PM
#1
Thread Starter
Lively Member
I'm new to asp so this has to be a pretty easy one you someone out there that is more seasoned.
User clicks on a day on the calendar to add an event and a popup window appears with fields for the event name, etc.
I want the date that the user selected on the calendar to appear selected in the combo boxes on the page's form.
The way I code it uses the parameters in the QueryString but it isn't working. Any help would be appreciated.
Code:
<%
Dim iMonth, iDay, iCounter
iMonth = Request.QueryString("Month")
iDay = Request.QueryString("Day")
%>
<td align="left">
<select name="Month" class="Input">
<%
For iCounter = 1 to 12
If iCounter <> iMonth Then
Response.Write "<option value='" & iCounter & "'"
Response.Write ">" & Left(MonthName(iCounter),3)
Response.Write vbCrLf
Else
Response.Write "<option value='" & iCounter & "'"
Response.Write " selected>" & Left(MonthName(iCounter),3)
Response.Write vbCrLf
End If
Next
%>
</select>
<select name="Day" class="Input">
<%
For iCounter = 1 to 31
If iCounter <> iDay Then
Response.Write "<option value='" & iCounter & "'"
Response.Write ">" & iCounter
Response.Write vbCrLf
Else
Response.Write "<option value='" & iCounter & "'"
Response.Write " selected>" & iCounter
Response.Write vbCrLf
End if
Next
%>
</select>
<select name="Year" class="Input">
<%
iYear = Year(now)
For iCounter = 1 to 4
Response.Write "<option value='" & iYear & "'"
Response.Write ">" & iYear
Response.Write vbCrLf
iYear = iYear + 1
Next
%>
</select>
</td>
-
Aug 31st, 2000, 08:58 PM
#2
New Member
It looks as though you are passing the value in the querystring as a string and then trying to compare it to a number. If you convert the string to an integer it should work, like:
...
If iCounter <> CInt(iMonth) Then
...
Hope this helps.
-
Sep 1st, 2000, 09:40 AM
#3
Thread Starter
Lively Member
ajc,
That worked. Thanks.
I'm used to VB and the ablilty to declare varables as a specific type and not worrying about type conversion.
I knew it would be something easy.
Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|