开发者

Jquery - validation - Rules

开发者 https://www.devze.com 2022-12-11 09:50 出处:网络
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 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

精彩评论

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