validator
http://rickharrison.github.io/validate.js/validate.js
rules: 'required|callback_check_password'
validator.registerCallback('check_password', function(value) {
if (passwordIsStrong(value)) {
return true;
}
return false;
})
.setMessage('check_password', 'Please choose a stronger password using at least 1 number.');
validator.setMessage('required', 'You must fill out the %s field.');
var validator = new FormValidator('example_form', [{
name: 'req',
display: 'required',
rules: 'required'
}, {
name: 'alphanumeric',
rules: 'alpha_numeric'
}, {
name: 'password',
rules: 'required'
}, {
name: 'password_confirm',
display: 'password confirmation',
rules: 'required|matches[password]'
}, {
name: 'email',
rules: 'valid_email',
depends: function() {
return Math.random() > .5;
}
}, {
name: 'minlength',
display: 'min length',
rules: 'min_length[8]'
}], function(errors, event) {
if (errors.length > 0) {
// Show the errors
}
});
1,rules: 'required'
2,rules: 'required|matches[password]'
3,rules: 'min_length[8]'
4,rules: 'valid_email',
validator.registerCallback('check_password', function(value) {
if (passwordIsStrong(value)) {
return true;
}
return false;
})
.setMessage('check_password', 'Please choose a stronger password using at least 1 number.');
validator的更多相关文章
- 客户端的验证插件validator
简单,智能,令人愉悦的表单验证~~~ 官方文档:http://www.niceue.com/validator/ <!DOCTYPE html> <html> <head ...
- 如何在SSM项目配置springMVC校验框架validator
1.在springMVC配置文件配置添加如下信息 <!-- 表单验证框架 --> <bean id="validator" class="org.spr ...
- Errors occurred during the build. Errors running builder 'JavaScript Validator' on project
1.问题:Errors occurred during the build. Errors running builder 'JavaScript Validator' on project 2.解决 ...
- struts2学习笔记--使用Validator校验数据
我们在进行一些操作是需要对用户的输入数据进行验证,比如网站的注册,需要对各个数据项进行数据校验,Struts2提供了一些默认的校验器,比如数字的检测,邮箱的检测,字符串长度的检测等等. 常用的Vali ...
- 用好spring mvc validator可以简化代码
表单的数据检验对一个程序来讲非常重要,因为对于客户端的数据不能完全信任,常规的检验类型有: 参数为空,根据不同的业务规定要求表单项是必填项 参数值的有效性,比如产品的价格,一定不能是负数 多个表单项组 ...
- jQuery validator自定义
项目中接触到validator,记录下 jQuery.validator.addMethod("isStrongPwd", function(value, element){ va ...
- spring-Formatter(格式化器)-validator(验证器)-错误信息定制
项目结构
- //解决validator验证插件多个name相同只验证第一的问题
//解决validator验证插件多个name相同只验证第一的问题 var validatorName = function () { if ($.validator) { $.validator.p ...
- Nice Validator(Form验证)及Juery zTree控件
http://niceue.com/validator/demo/match.php http://www.ztree.me/v3/demo.php#_603
- 解决eclipse-helios中Errors running builder JavaScript Validator的问题(转)
原文地址:http://hi.baidu.com/%B3%BF%D1%F4%C2%FE%B2%BD/blog/item/2528f6de3ca90955ccbf1a3f.html 最近下载了eclip ...
随机推荐
- golang chan 超时
golang chan 超时 Posted on 2013-12-24 13:03 oathleo 阅读(4227) 评论(0) 编辑 收藏 package main import ( &q ...
- D3.js 理解 Update、Enter、Exit
Update.Enter.Exit 是 D3 中三个非常重要的概念,它处理的是当选择集和数据的数量关系不确定的情况. 一.什么是 Update.Enter.Exit svg.selectAll(&qu ...
- redis+tomcat+nginx session共享
http://www.cnblogs.com/zhrxidian/p/5432886.html系列课程 简洁明了 http://blog.csdn.net/grhlove123/article/det ...
- sap 中怎样把非限制库存转为销售订单库存?
把非限制库存转为销售订单库存: MB1B 移动类型413 把销售订单库存转为非限制库存: MB1B移动类型411 E 切记!
- mydbtest文档
mydbtest是楼方鑫编写的一个数据库测试工具,有需要的话,请自取 http://pan.baidu.com/s/1mgJpukg#path=%252FOneSQL%252FDocument 找到& ...
- windows+tomcat 7配置二级域名访问其他web程序
1.在域名管理中做好二级域名的解析 2.在tomcat的server.xml中增加如下: <Host name="wx.ai77.cn" debug="0" ...
- mysql通过binlog日志来恢复数据
简介 在生产的过程中有这么一个业务场景:比如我在2016-11-19 09:30:00 通过mysqldump的方式备份了数据库,但是在2016-11-19 10:30:00的时候数据库崩溃了,如果通 ...
- wxpython颜色选择
Color Code Color Name Color #000000 BLACK #0000FF BLUE #007FFF SLATE BLUE #00FF00 GREEN #00F ...
- Combination Sum [LeetCode]
Problem Description: http://oj.leetcode.com/problems/combination-sum/ Basic idea: It seems complicat ...
- NSException
NSException是什么? 最熟悉的陌生人,这是我对NSException的概述,为什么这么说呢?其实很多开发者接触到NSException的频率非常频繁,但很多人都不知道什么是NSExcepti ...