Jump to content

ganesh12

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ganesh12

  • Rank
    Newbie
  1. <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script src="js/jquery-1.9.0.min.js"></script> <script src="js/jquery.validate.min.js"></script> </head> <body> <form id="loginForm" method="post"> Enter Name<input type="text" name="txtname"><br /> Enter Email<input type="text" name="txtemail"><br /> Enter ######:<input type="radio" name="gender" value="male">male <input type="radio" name="gender" value="female">female<br> <input type="submit" value="Login" /> </form> <script> $(document).ready(function(){ $('#loginForm').validate({ rules:{ txtname:{ required:true, minlength:1, maxlength:40 }, txtemail:{ required:true, email:true }, gender:{ required:true, }, }, messages:{ txtname:{ required:"Name required", minlength:"Name at least 1 char long", maxlength:"Name max 40 char long" }, txtemail:{ required:"Email Required", email:"Invalid Emal" }, gender:{ required:"gender is required", } } }); }); </script> </body> </head> </html>
×
×
  • Create New...