我的问题我的页面中有上述表格。我想使用 jquery 验证引擎验证表单。你能告诉我如何验证它以及要包含哪些文件。现在,我已经在脑海中包含了 jquery 验证引擎。我只想知道如何触发验证引擎并在文本字段的模糊上显示错误消息。非常感谢提前。请在下面找到我的代码:
<script src="../js/jquery-1.6.min.js" type="text/javascript"></script>
<script src="scripts/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="scripts/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
// binds form submission and fields to the validation engine
$('#myForm').validationEngine('validate');
});
</script>
<form class="container" id="myForm" method="post" action="">
<div>
<span>Field is required : </span>
<label for="Firstname">Firstname</label>
<input type="text" class="validate[required] text-input" id="name" name="Firstname"/>
</div>
<div>
<span>Field is required : </span>
<label for="name">middlename</label>
<input type="text" id="name" name="middlename" class="validate[required] text-input"/>
</div>
<div>
<span>Field is required : </span>
<label for="name">lastname</label>
<input type="text" id="name" name="lastname" class="validate[required] text-input"/>
</div>
</form>