: Http://jqueryui.com/download,themeselect sunny
Interface code:
Copy codeThe Code is as follows: <form id = "form1" runat = "server">
<Div align = "center">
<Fieldset style = "width: 400px; height: 150px">
<Table border = "0" cellpadding = "3" cellspacing = "3">
<Tr>
<Td colspan = "2">
Enter the date range:
</Td>
</Tr>
<Tr>
<Td>
Start Time:
</Td>
<Td>
<Asp: TextBox ID = "txtStartDate" runat = "server"> </asp: TextBox>
</Td>
</Tr>
<Tr>
<Td>
End Time:
</Td>
<Td>
<Asp: TextBox ID = "txtEndDate" runat = "server"> </asp: TextBox>
</Td>
</Tr>
<Tr>
<Td colspan = "2">
<Asp: Button ID = "btnSubmit" runat = "server" Text = "Submit"/> <asp: Button ID = "btnReset" runat = "server"
Text = "reset"/>
</Td>
</Tr>
</Table>
</Fieldset>
</Div>
</Form>
Script code:Copy codeThe Code is as follows: <Title> Recipe14 </title>
<Link rel = "Stylesheet" href = "Styles/sunny/jquery-ui-1.8.17.custom.css"/>
<Script type = "text/javascript" src = "Scripts/jquery-1.4.1-vsdoc.js"> </script>
<Script type = "text/javascript" src = "Scripts/jquery-ui-1.8.17.custom.min.js"> </script>
<Script type = "text/javascript">
$ (Function (){
$ ("# TxtStartDate"). datepicker ();
$ ("# TxtEndDate"). datepicker ();
$ ("# BtnSubmit"). click (function (e ){
E. preventDefault ();
Var startdate = Date. parse ($ ("# txtStartDate"). val ());
Var enddate = Date. parse ($ ("# txtEndDate"). val ());
If (startdate> enddate ){
Alert ("the start time cannot be later than the end time! ");
}
});
$ ("# BtnReset"). click (function (e ){
E. preventDefault ();
$ ("# TxtStartDate"). val ("");
$ ("# TxtEndDate"). val ("");
});
});
</Script>
</Head>
Final interface: