jQuery.validator.addMethod("notNumber", function(value, element, param) { var reg = /[0-9]/; if(reg.test(value)){ return false; }else{ return true; } }, "Number is not permitted");
Eduardo Pinzon Web Developer 2009/8/10 nouky <a.noor...@gmail.com> > > What I really wanted to do is use the jQuery validator and in the > function set a validation that numbers are not allowed in a text > input. > > For example I have this code: > $(document).ready(function() { > // validate signup form on keyup and submit > var validator = $("#signupform").validate({ > rules: { > firstname: "required", > lastname: "required", > username: { > required: true, > minlength: 2, > remote: "users.php" > } > } > }); > }); > > How do I set the validation that no number are allowed in the > firstname text box???? > > > > On Aug 10, 8:52 am, nouky <a.noor...@gmail.com> wrote: > > I'm not that good with javascript. > > > > If the textboxt name is txtname, how do you incorporate it in the code > > above??? >