类型错误:验证在jquery.validate.js未定义 [英] TypeError: validator is undefined in jquery.validate.js

查看:1765
本文介绍了类型错误:验证在jquery.validate.js未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有如下形式。

在这里输入的形象描述

当我单击转到下一节按钮,我可以直接在这种形式下一部分。

下面的该视图整个code 该视图页面布局文件

但现在当我点击我没有得到任何回应,我不能转到下一个页面我得到以下error.But只发生在Firefox这个错误,我曾经更改调试到Chrome浏览器中运行。


  

类型错误:验证是不确定的FILE_PATH / jquery.validate.js


这是错误观点。

错误观点1

在这里输入的形象描述

在我点击以上观点,我可以看到下面的视图

错误观点2

在这里输入的形象描述

Bugzilla的调试指出以下部分( [IF(validator.settings.rules)] )的 jquery.validate.js 文件的错误

  STATICRULES:功能(元素){
    变种规则= {};
    VAR验证= $。数据(element.form,验证);
    如果(validator.settings.rules){
        规则= $ .validator.normalizeRule(validator.settings.rules [element.name])|| {};
    }
    返回规则;
},


解决方案

我相信你需要更新你的HTML和更改< D​​IV CLASS =形横> <窗​​体类=形横> 。不要忘记更新结束标记为好。

I have following form.

once I click that Go to Next Section Button I can direct to next section in this form.

Here the whole code for this view and this the Layout file for that view page

But now Once I click I'm not getting any response and I cannot goto next page I'm getting following error.But this error occur in Firefox only , once I change debugging to Chrome this is working.

TypeError: validator is undefined file_path/jquery.validate.js

this is that error view

Error view 1

once I click above view I can see below view

Error view 2

Bugzilla debugger pointed out following section ([if (validator.settings.rules)]) of jquery.validate.js file has the error

staticRules: function( element ) {
    var rules = {};
    var validator = $.data(element.form, "validator");
    if ( validator.settings.rules ) {
        rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {};
    }
    return rules;
},

解决方案

I believe you need to update your HTML and change <div class="form-horizontal"> to <form class="form-horizontal">. Don't forget to update the closing tag as well.

这篇关于类型错误:验证在jquery.validate.js未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆