jquery validationEngine不工作 - jtable

时间:2012-09-19 18:18:57

标签: javascript jquery jquery-plugins jquery-jtable

我正在使用jtable(jtable.org),无法使validationEngine正常工作。

这是我在我的firbug控制台中遇到的错误:

TypeError: data.form.validationEngine is not a function

这是我的jscript代码:

},
//Initialize validation logic when a form is created
formCreated: function (event, data) {
     data.form.find('input[name="Name"]').addClass(
    validate[required]');
     data.form.validationEngine();
},
//Validate form when it is being submitted
formSubmitting: function (event, data) {
     return data.form.validationEngine('validate');
},
//Dispose validation logic when form is closed
formClosed: function (event, data) {
         data.form.validationEngine('hide');
        data.form.validationEngine('detach');
}
});

我也在页面顶部包含这个内容:

<!-- Import CSS file for validation engine (in Head section of HTML) -->
<link href="scripts/validationEngine/validationEngine.jquery.css" rel="stylesheet" type="text/css" />

<!-- Import Javascript files for validation engine (in Head section of HTML) -->
<script type="text/javascript" src="scripts/validationEngine/jquery.validationEngine.js"</script>
<script type="text/javascript" src="scripts/validationEngine/jquery.validationEngine-en.js"></script>

1 个答案:

答案 0 :(得分:2)

而不是使用验证引擎1, 我用过引擎2 把它放在控制js上

inputClass:'validate [required]'

然后把 在jtable结束时需要验证js填充js。

希望这会有所帮助

避免在页面上使用任何外部js,这可能导致JQUERY.conflict()场景