|
CodeAve.com - ASP - Server Variables | |||
|
||||
| Form Dates | ||||
|
|
||||
<html> <title>CodeAve.com(DropDown Menu Dates)</title> <body bgcolor="#FFFFFF"> <% ' Requests all the form ekements that may be passed u_date=request.form("u_date") u_month=request.form("u_month") u_day=request.form("u_day") u_year=request.form("u_year") ' Checks to see if either form was submitted if (u_month <> "") or (u_date <> "") then %><center>You selected <br> <% ' If the first form was selected display the user input if (u_month <> "") then response.write u_month & "/" & u_day & "/" & u_year end if ' If the second form was selected display the user input if (u_date <> "") then response.write u_date end if %> <% ' If neither form is selected display two forms set to todays date else %> <form action="<%= request.servervariables("script_name") %>" method="post"> <select size="1" name="u_date"> <% ' This loop will create a dropdown menu with the past ten days for counter = date()-10 to date() %> <option <% ' select the current date to display it if counter = date() then %> selected <% end if %> value="<%= counter %>"><%= counter %></option> <% next %> </select> <input type="submit"> </form> <p> </p> <p> </p> <form action="<%= request.servervariables("script_name") %>" method="post"> <select size="1" name="u_month"> <% ' Start a loop to create the twelve months of the year for counter = 1 to 12 %> <option <% ' Select the current month to display if counter = month(date()) then %> selected <% end if %> value="<%= counter %>"><%= counter %></option> <% next %> </select> <select size="1" name="u_day"> <% ' Start a loop to create the days of the month for counter = 1 to 31 %> <option <% ' Select the current day to display if counter = day(date()) then %> selected <% end if %> value="<%= counter %>"><%= counter %></option> <% next %> </select> <select size="1" name="u_year"> <% ' Start a loop to create the years prior and previous for counter = 1998 to 2005 %> <option <% ' Select the current year to display if counter =year(date()) then %> selected <% end if %> value="<%= counter %>"><%= counter %></option> <% next %> </select> <input type="submit"> <% end if %> </body> </html>
|
||||
|
|
||||