jQuery-验证-规则 [英] Jquery - validation - Rules

查看:90
本文介绍了jQuery-验证-规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JQ-验证插件来验证我的表单.但是我不知道在jquery中什么样的验证规则!您能给我推荐一个我可以阅读有关规则的页面吗?

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?

我有两个字段NAME和AGE,我希望它验证REQUIRED,MAXLENGTH,NUMBER/CHAR,MIN,MAX

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?

谢谢.

推荐答案

您可以在此处找到有关验证插件的所有信息:

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

此外,阅读示例代码可能对您有帮助: http://jquery.bassistance. de/validate/demo/

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

这篇关于jQuery-验证-规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆