<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<link rel="stylesheet" href="//ku.shouce.ren/libs/validation-engine/2.6.2/css/validationEngine.jquery.css">
<script type="text/javascript" src="https://ku.shouce.ren/libs/jquery/1/jquery1.7.2.min.js">
</script>
<script src="//ku.shouce.ren/libs/validation-engine/2.6.2/js/jquery.validationEngine-zh_CN.js">
</script>
<script src="//ku.shouce.ren/libs/validation-engine/2.6.2/js/jquery.validationEngine.min.js">
</script>
</head>
<body>
<div class="main">
<div class="inwrap">
<h1>jQuery Validation Engine 表单验证中文版
</h1>
<h2>只显示一个提示信息
</h2>
<div class="detail">
<p>通过参数
<code>showOneMessage
</code>设置,是否在表单验证的时候,只显示一个提示信息。
</p>
</div>
<div class="example">
<form id="formID" class="formular" method="post">
<fieldset>
<legend>必填项
</legend>
<input value="" data-validation-engine="validate[required]" class="text-input" type="text" name="req" id="req">
<label>喜欢的运动 1:
</label>
<select name="sport" id="sport" data-validation-engine="validate[required]">
<option value="">选择一项运动
</option>
<option value="option1">网球
</option>
<option value="option2">足球
</option>
<option value="option3">高尔夫球
</option>
</select>
<label>喜欢的运动 2:
</label>
<select name="sport2" id="sport2" multiple data-validation-engine="validate[required]">
<option value="">选择一项运动
</option>
<option value="option1">网球
</option>
<option value="option2">足球
</option>
<option value="option3">高尔夫球
</option>
</select>
<code>validate[required]
</code>
</fieldset>
<input class="submit" type="submit" value="验证 & 提交表单">
</form>
</div>
</div>
</div>
<script>
jQuery(document).ready(function(){
// binds form submission and fields to the validation engine
jQuery('#formID').validationEngine({
showOneMessage: true
}
);
}
);
</script>
</body>
</html>