https://github.com/xucongli1989/jqueryvalidateextendmethod
jquery.validate.js 自定义扩展验证方法
https://github.com/xucongli1989/jqueryvalidateextendmethod
ajax javascript jquery jquery-plugin jquery-validate jquery-validation
Last synced: about 1 year ago
JSON representation
jquery.validate.js 自定义扩展验证方法
- Host: GitHub
- URL: https://github.com/xucongli1989/jqueryvalidateextendmethod
- Owner: xucongli1989
- License: mit
- Created: 2015-08-24T10:28:55.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-11T14:23:41.000Z (over 9 years ago)
- Last Synced: 2025-01-28T23:30:35.612Z (about 1 year ago)
- Topics: ajax, javascript, jquery, jquery-plugin, jquery-validate, jquery-validation
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 简介
这是著名的jquery表单验证插件[jquery.validate.js](https://jqueryvalidation.org/) 的扩展验证方法库。
# 部分扩展
## ajax远程验证 ##
注意:ajax返回的必须为json格式,且至少要包含IsSuccess(验证是否通过)、Message(提示信息)属性
var validator = $("form:first").validate({
rules: {
txtRoleName: {
required: true,
XCLCustomRemote: {
url: "http://www.x.com/xxx",
data: {............}
}
},
txtCode: {
XCLCustomRemote: {
url: "http://www.x.com/xxx",
data: function () {//支持function
return {...........};
}
}
},
txtMerchantID: {
required: true
}
}
});
## 自定义错误消息显示位置 ##
如果被验证的元素存在"JqValidShowErrorID"属性,则将错误信息放到ID为该属性值的元素中,否则,则默认。
当然,您也可以直接修改源代码,添加您所需要的其它信息。