Validation issues with JQuery

master_kai

New Member
iam working on a JQuery validation as below: (iam not much aware of jquery much)..I am unable to accomplish below things:
[*]only letters a to z (lower case), "-" (dash or hyphen) and " "(space) are allowed,[*]the "-" (dash) AND " " (space) letters MUST be entered,[*]the "-" or the " " letter must not be either the first or the lastletter entered,[*]"-" must not be the immediate neighbour or adjacent (before orafter) to a " ",[*]"-" or " " must not be the immediate neighbour (adjacent) toitself.[*]The 'telephone' number field (4 digit area code, a space, 7 digitlocal code)
\[code\]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"> </script> <script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"> </script> <script> $(document).ready(function(){ $("#commentForm").validate({ onfocusout: function(element) { $(element).valid(); } , rules: { fullname : { required: true, maxlength: 14, }, email: { required: true, email: true } }, messages: { fullname : { required: "Please specify your Full Name", maxlength: "Please enter only upto 14 characters", }, email: { required: "We need your email address to contact you", email: "Your email address must be in the format of [email protected]" } } }); }); </script> </head> <body> <form id="commentForm" method="get" action=""> <fieldset> <p> <label for="fullname">Full Name</label> <em>*</em><input id="fullname" name="fullname" size="25" class="required" maxlength="14" /> </p> <p> <label for="email">E-Mail</label> <em>*</em><input id="email" name="email" size="25" class="required email" /> </p> </fieldset> </form> </body></html>\[/code\]please someone help me in achieving this..?
 
Back
Top