NextIndexPrevious

Programs in JQuery

3. Form validation program in JQuery.

<script src="jquery-1.9.1.js"></script>
<script src="jquery.validate.js"></script>
<style>
.cls1{color:red;}
</style>
<script>
function fun1()
{
	$("#frm1").validate({errorClass:'cls1'})
}
</script>
<body onload="fun1()">
<form id="frm1" action="">
User name:<input type="text" name="t1" class="required" minlength="6"
 maxlength="30"><br>
Age:<input type="text" name="t2" class="required number" min="20" max="50"><br>
Email-id:<input type="text" name="t3" class="email required"><br>
Password:<input type="text" name="txtpwd" id="txtpwd"><br>
Confirm-password:<input type="text" name="txtrpwd" id="txtrpwd" equalTo="#txtpwd">
<br>
Url:<input type="text" name="txturl" class="url"><br>
<input type="submit" name="sub" value="Register">
</body>

Output :
User name:
Age:
Email-id:
Password:
Confirm-password:
Url:


Note: In case URL, enter complete address. Example: http://www.google.com.

Creater of JQuery


John Resig

John Resig

Born: May 8, 1984, Boston, U.S.A.