views:

117

answers:

2

Hello!

I use JQ - validation plugin to validate my form. But i dont know what kind of validation rules in jquery! Could you suggest me a page where i can read about rules?

I have two field, NAME and AGE, and i want it to validate for REQUIRED, MAXLENGTH, NUMBER /CHAR, MIN, MAX

 rules: {
    new_name: {
    required: true,
    maxlength: 30,
    **number: false  //?? I dont want to allowd numbers, only alphabetic chars.**

 },
 new_age: {
    required: true,
    maxlength: 3,
    **chars: false  //?? I dont want to allowd numbers, only alphabetic chars.**
    **min: 1 // 1 is the lowest number what they allowed**
     **max: 30 // 120 is the highest number what they allowed**
 },

Is it possible, without write an own rule?

Thank you.

+1  A: 

You can find everything about the validation plugin here: http://bassistance.de/jquery-plugins/jquery-plugin-validation/

Furthermore, reading the code of the examples might help you: http://jquery.bassistance.de/validate/demo/

brainfck
Thank you. I find everything except the " Chars " - not number rule. What do you think, how can i validate to only accept " a-z" chars?
Holian
Lettersonly - this is the key:)
Holian
A: 

You can find your validating requirements for chars using regex here:
JQuery validate: How to add a rule for regular expression validation?

o.k.w