<%
Option Explicit
Dim strDate
'Record input date, Period type.
Dim datDate
'Test whether the input date is correct, date type.
<Html>
%>
<Head>
<Title> Verification of qianniu flying date </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Link rel = "stylesheet" href = "../Css/export.css" type = "text/css">
</Head>
<Body text = "#000000">
<Form name = "InputDate" ACTION = "<% = Request. ServerVariables (" script_NAME ") %>" METHOD = "POST">
<Table width = "500" border = "1" cellpadding = "0" cellspacing = "0" align = "center">
<Tr>
<Td background = "../Pic/br.jpg">
<Table width = "500" border = "0" cellpadding = "4" cellspacing = "4" class = "9 p">
<Tr>
<Td colspan = "2"> </td>
</Tr>
<Tr>
<Td colspan = "2" height = "60">
<Div align = "center"> enter the date to be queried:
<Input type = "text" name = "strDate" value = "<% = Cstr (Year (Now ())) & "-" & Cstr (Month (Now ()))
& "-" & Cstr (Day (Now () %> "size =" 10 "maxlength =" 10 ">
</Div>
</Td>
</Tr>
<Tr>
& Lt; td width = "50%" & gt;
<Div align = "center">
<Input type = "submit" name = "Submit" value = "OK">
</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 = "avascript">
<! --
InputDate. action = "TypeAlert. asp"
InputDate. submit ()
// -->
</Script>
<%
Else
%>
<Script Language = "avascript">
<! --
Alert ("oh, the date you entered is incorrect. Please try again! ")
// -->
</Script>
<%
End If
End If
%>
</Body>
[1]