(1)required:true 必输字段(2)remote:"check.php" 使用ajax方法调用check.php验证输入值(3)email:true 必须输入正确格式的电子邮件(4)url:true 必须输入正确格式的网址(5)date:true 必须输入正确格式的日期(6)dateISO:true 必须输入正确格式的日期(ISO),例如:2009-06-23,1998/01/22 只验证格式,不验证有效性(7)number:true 必须输入合法的数字(负数,小数)(8)digits:true 必须输入整数(9)creditcard: 必须输入合法的信用卡号( Read More
posted @ 2013-10-08 18:58
tinyphp
Views(733)
Comments(0)
Diggs(0)
jQuery.validator.addMethod添加自定义的验证规则addMethod:name, method, message简单实例:单个验证的添加validate.js拓展验证validate.expand.jsjQuery.validator.addMethod("isZipCode", function(value, element) { var tel = /^[0-9]{6}$/; return this.optional(element) || (tel.test(value));}, "请正确填写您的邮政编码");多个验证方法添加 Read More
posted @ 2013-10-08 18:27
tinyphp
Views(942)
Comments(0)
Diggs(1)
jquery.validate.js插件里面的样式设置:...errorClass: "error",validClass: "valid",... Read More
posted @ 2013-10-08 17:48
tinyphp
Views(1519)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号