juqery.validate.js中发现elements方法中$([]).add(this.currentForm.elements)方法在ie8下有问题,只能得到一个jquery对象。(ie9和火狐浏览器正常)
后来根据源码中的注释提示在网站 http://bugs.jquery.com/ticket/2114
得到答案 :
原文:
I had an issue where jquery.validate was failing in IE6, caused by
the above error. I fixed this by updating line 446 and changed:
$([]).add(this.currentForm.elements).filter(":input")
to
$(':input',this.currentForm)
于是把juqery.validate.js中elements方法
return $([]).add(this.currentForm.elements)
.filter(":input")
.not(":submit, :reset, :image, [disabled]")
.not( this.settings.ignore )
.filter(function() {
!this.name && validator.settings.debug &&
window.console && console.error( "%o has no name assigned",
this);
// select only the first element for each name, and only those with rules specified
if ( this.name in rulesCache || !validator.objectLength($(this).rules()) )
return false;
rulesCache[this.name] = true;
return true;
});
修改为:
return $(':input',this.currentForm)
.not(":submit, :reset, :image, [disabled]")
.not( this.settings.ignore )
.filter(function() {
!this.name && validator.settings.debug &&
window.console && console.error( "%o has no name assigned",
this);
// select only the first element for each name, and only those with rules specified
if ( this.name in rulesCache || !validator.objectLength($(this).rules()) )
return false;
rulesCache[this.name] = true;
return true;
});
分享到:
相关推荐
jquery.validate 兼容IE6/IE7/IE8
项目用到了jquery的表单校验插件validate,但在ie8下有bug,下面有个不错的解决方法,需要的朋友可以参考下
jquery validate例子 能用
jquery validate 使用详解
NULL 博文链接:https://wwwzhouhui.iteye.com/blog/1068451
jquery validate 验证手册
自做的一个简单的表单验证 jquery validate 表单验证 jquery validate 表单验证
jQueryValidate
jquery validate方法 可以自定义方法,比如电话号码验证,判断两个字符串相等
JQuery validate中文详细文档
Jquery validate和form两个插件,完美进行表单验证和Ajax无刷新方式提交form表单,很有用的哦。
jquery.validate.1.9.0.min.js jquery.validate.1.12.0.min.js jquery.validate.1.13.1.min.js jquery.validate.1.16.0.min.js jquery.validate.1.14.0.min.js jquery.validate.1.15.1.min.js jquery.validate....
解决jquery validate remote 只验证一次的问题
jquery-validate 可对前端form进行表单校验,文档里详细介绍了如何使用jquery-validate框架和如何扩展验证方法。
jQuery Validate jQuery Validate 插件为表单提供了强大的验证功能,让客户端表单验证变得更简单,同时提供了大量的定制选项,满足应用程序各种需求。该插件捆绑了一套有用的验证方法,包括 URL 和电子邮件验证,...
所有的捆绑方法默认使用英语作为错误信息,且已翻译成其他 37 种语言。 该插件是由 Jörn Zaefferer 编写和维护的,他是 jQuery 团队的一名成员,是 jQuery UI 团队的主要开发人员,是 QUnit 的维护人员。该插件在 ...
jquery validate 最稳定版本,最简单的使用方法:http://blog.csdn.net/s592652578/article/details/50845159
jquery validate 教程 验证框架 帮助文档 中文文档 基于jQuery的客户段验证插件
jQuery validate 验证 个性化验证
jQuery Validate插件验证表单小练。