1.加入以下語法:
<link rel='stylesheet' href='css/validationEngine.jquery.css' type='text/css' media='screen' charset='utf-8' />
<link rel='stylesheet' href='css/template.css' type='text/css' media='screen' title='no title' charset='utf-8' />
<script src='js/jquery-1.6.min.js' type='text/javascript'></script><!--端視之前有無引入 jquery-->
<script src='js/languages/jquery.validationEngine-tw.js' type='text/javascript'></script>
<script src='js/jquery.validationEngine.js' type='text/javascript'></script>
<script type='text/javascript'>
$(document).ready(function() {
$('#myform').validationEngine({
inlineValidation: true,
success : false,
failure : function() {}
});
});
</script>
(1) 提示的位置:「promptPosition: "topRight", 」選項有:topLeft, topRight, bottomLeft, centerRight, bottomRight
(2) 是否邊輸入邊檢查:「inlineValidation: true,」
2.表單要做的變化:記得在<form>中加入id="myform",要對應上面的$("#myform")。
在欄位中加入參數:<input name='id' type='text' id='id' class='validate[required , custom[onlyLetter] , length[0,10]]'>
4.單選鈕的寫法:<input name="sex" type="radio" value="男" class="validate[required] radio">
5.複選鈕的寫法:<input name="hobby" type="checkbox" id="hobby" value="琴" class="validate[minCheckbox[2]] checkbox">