我正在使用 jtable (jtable.org) 并且无法让验证引擎工作。
这是我在 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>