<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="jQueryValidation.aspx.cs" Inherits="JSON_And_jQuery.jQueryValidation" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Client-side validation using jQuery</title>
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
<script src="js/jquery.validate.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready
(
function()
{
$("#form1").validate
(
{
rules:
{
txtName:
{
required: true
},
txtEmail:
{
required: true, email: true
},
txtPostalAddress:
{
required: true
}
},
messages:
{
}
}
);
}
);
</script>
</head>
<body>
<form id="form1" runat="server">
<div ><span>Name *</span><asp:TextBox runat="server" ID="txtName" Name="txtName"></asp:TextBox></div>
<div ><span>E-Mail *</span><asp:TextBox runat="server" ID="txtEmail" Name="txtEmail"></asp:TextBox></div>
<div ><span>Postal Address *</span><asp:TextBox runat="server" ID="txtPostalAddress" Name="txtPostalAddress"></asp:TextBox></div>
<div><asp:Button ID="btnOK" runat="server" Text="OK" /></div>
</form>
</body>
</html>