开发者

Jquery - validation - Rules

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.


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/


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜