一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

jquery validate插件验证名称数组同名例子

时间:2014-01-24 编辑:简简单单 来源:一聚教程网


jquery.validate.js
修改

 代码如下 复制代码
checkForm: function() {
            /*this.prepareForm();
            for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) {
                this.check( elements[i] );
            }
            return this.valid();*/
            this.prepareForm();
            for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) {
                if (this.findByName( elements[i].name ).length != undefined && this.findByName( elements[i].name ).length > 1) {
                    for (var cnt = 0; cnt < this.findByName( elements[i].name ).length; cnt++) {
                            this.check( this.findByName( elements[i].name )[cnt] );
                    }
                } else {
                    this.check( elements[i] );
                }
            }
            return this.valid();
        },

热门栏目