The error has just been asked to use JavaScript to verify the date, recall that they wrote a bunch of functions to verify the date, and did not involve a leap year problem, recently saw ASP 3.0 about on the Error Resume next usage, brainwave, hehe ... It's so cool!
<%
Option Explicit
Dim strdate ' records the date entered, character type
Dim datdate ' test input date is correct, date type %>
<title> Date Selection </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<link rel= "stylesheet" href= ". /css/export.css "type=" Text/css ">
<body bgcolor= "#FFFFFF" text= "#000000" >
<form name= "Inputdate" action= <% = Request.ServerVariables ("Script_name")%> "method=" POST >
<table width= "border=" 1 "cellpadding=" 0 "cellspacing=" 0 "align=" center ">
<tr>
<td background= ". /pic/br.jpg ">
<table width= "border=" 0 "cellpadding=" 4 "cellspacing=" 4 "class=" 9p ">
<tr>
<TD colspan= "2" > </td>
</tr>
<tr>
<TD colspan= "2" height= ">"
<div align= "center" > Please enter the date you want to query:
<input type= "text" name= "strdate" value= "<% = CStr (year (today)) &"-"& CStr (Month (now)) &"-"& C STR (day ())%> "size=" maxlength= "ten" >
</div>
</td>
</tr>
<tr>
<TD width= "50%" >
<div align= "center" >
<input type= "Submit" name= "Submit" value= "Confirmation" >
</div>
</td>
<td>
<div align= "center" >
<input type= "reset" name= "Submit2" value= "Cancel" >
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</Form>
<%
Strdate = Request.Form ("strdate")
If strdate <> "" Then
On Error Resume Next
Datdate = CDate (strdate)
If Err.Number = 0 Then
%>
<script language= "JavaScript" >
<!--
inputdate.action= "Typealert.asp"
Inputdate.submit ()
-->
</Script>
<%
Else
%>
<script language= "JavaScript" >
<!--
Alert ("You entered the wrong date, please re-enter!") ")
-->
</Script>
<%
End If
End If
%>
</body>