gradinumcp
IS-IT--Management
Heres my code that displays a drop-down menu with Month: and Day:. I want that when user chooses January, it displays 31 days in the days drop-down and for april or june 30 days. However it displays only 30 days for all months--any clue whats wrong????
<form method=POST action=Time.asp name=Page1>
<table>
<tr>
Month: <select name=Month>
<option value=''></option>
<option <% if request("Month")=1 then %>selected<% end if %> value='1'>Jaunary</option>
<option <% if request("Month")=2 then %>selected<% end if %> value='2'>February</option>
<option <% if request("Month")=3 then %>selected<% end if %> value='3'>March</option>
<option <% if request("Month")=4 then %>selected<% end if %> value='4'>April</option>
<option <% if request("Month")=5 then %>selected<% end if %> value='5'>May</option>
<option <% if request("Month")=6 then %>selected<% end if %> value='6'>June</option>
<option <% if request("Month")=7 then %>selected<% end if %> value='7'>July</option>
<option <% if request("Month")=8 then %>selected<% end if %> value='8'>August</option>
<option <% if request("Month")=9 then %>selected<% end if %> value='9'>September</option>
<option <% if request("Month")=10 then %>selected<% end if %> value='10'>October</option>
<option <% if request("Month")=11 then %>selected<% end if %> value='11'>November</option>
<option <% if request("Month")=12 then %>selected<% end if %> value='12'>December</option>
</select>
<% if Month(Date())=1 or Month(Date())=3 or Month(Date())=5 or Month(Date())=7 or Month(Date())=8 or Month(Date())=10 or Month(Date())=12 then %>
Day: <select name=Day class=fields>
<option value=''></option>
<%
x=1
do while x<=31 %>
<option <% if cint(request("Day"))=x then %>selected<% end if %> value='<%=x%>'><%=x%></option>
<% x=x+1
Loop %>
<% elseif Month(Date())=4 or Month(Date())=6 or Month(Date())=9 or Month(Date())=11 then %>
Day: <select name=Day class=fields>
<option value=''></option>
<%
x=1
do while x<=30 %>
<option <% if cint(request("Day"))=x then %>selected<% end if %> value='<%=x%>'><%=x%></option>
<% x=x+1
Loop %>
<% else %>
Day: <select name=Day class=fields>
<option value=''></option>
<%
x=1
do while x<=28 %>
<option <% if cint(request("Day"))=x then %>selected<% end if %> value='<%=x%>'><%=x%></option>
<% x=x+1
Loop %>
<% end if %>
</select>
Year: <select name=Year class=fields>
<option value=''></option>
<%
x=0
do while x<>2 %>
<option <% if cint(request("Year"))=Year(Date())-x then %>selected<% end if %> value='<%=Year(Date())-x%>'><%=Year(Date())-x%></option>
<% x=x+1
Loop %>
</select>
<input type=button value="Get Time Information" class=fields2 onclick="CheckVals();">
</td>
</tr>
</table>
</form>
<form method=POST action=Time.asp name=Page1>
<table>
<tr>
Month: <select name=Month>
<option value=''></option>
<option <% if request("Month")=1 then %>selected<% end if %> value='1'>Jaunary</option>
<option <% if request("Month")=2 then %>selected<% end if %> value='2'>February</option>
<option <% if request("Month")=3 then %>selected<% end if %> value='3'>March</option>
<option <% if request("Month")=4 then %>selected<% end if %> value='4'>April</option>
<option <% if request("Month")=5 then %>selected<% end if %> value='5'>May</option>
<option <% if request("Month")=6 then %>selected<% end if %> value='6'>June</option>
<option <% if request("Month")=7 then %>selected<% end if %> value='7'>July</option>
<option <% if request("Month")=8 then %>selected<% end if %> value='8'>August</option>
<option <% if request("Month")=9 then %>selected<% end if %> value='9'>September</option>
<option <% if request("Month")=10 then %>selected<% end if %> value='10'>October</option>
<option <% if request("Month")=11 then %>selected<% end if %> value='11'>November</option>
<option <% if request("Month")=12 then %>selected<% end if %> value='12'>December</option>
</select>
<% if Month(Date())=1 or Month(Date())=3 or Month(Date())=5 or Month(Date())=7 or Month(Date())=8 or Month(Date())=10 or Month(Date())=12 then %>
Day: <select name=Day class=fields>
<option value=''></option>
<%
x=1
do while x<=31 %>
<option <% if cint(request("Day"))=x then %>selected<% end if %> value='<%=x%>'><%=x%></option>
<% x=x+1
Loop %>
<% elseif Month(Date())=4 or Month(Date())=6 or Month(Date())=9 or Month(Date())=11 then %>
Day: <select name=Day class=fields>
<option value=''></option>
<%
x=1
do while x<=30 %>
<option <% if cint(request("Day"))=x then %>selected<% end if %> value='<%=x%>'><%=x%></option>
<% x=x+1
Loop %>
<% else %>
Day: <select name=Day class=fields>
<option value=''></option>
<%
x=1
do while x<=28 %>
<option <% if cint(request("Day"))=x then %>selected<% end if %> value='<%=x%>'><%=x%></option>
<% x=x+1
Loop %>
<% end if %>
</select>
Year: <select name=Year class=fields>
<option value=''></option>
<%
x=0
do while x<>2 %>
<option <% if cint(request("Year"))=Year(Date())-x then %>selected<% end if %> value='<%=Year(Date())-x%>'><%=Year(Date())-x%></option>
<% x=x+1
Loop %>
</select>
<input type=button value="Get Time Information" class=fields2 onclick="CheckVals();">
</td>
</tr>
</table>
</form>