http://code.ciaoca.com/jquery/validation_engine/
用法:
1.引入css、js
<link href="${base}/res/basic/css/jquery/validationEngine/validationEngine.jquery.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="${base}/res/basic/js/jquery/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="${base}/res/basic/js/jquery/validationEngine/jquery.validationEngine.js" charset="utf-8"></script> <script type="text/javascript" src="${base}/res/basic/js/jquery/validationEngine/jquery.validationEngine-zh_CN.js" charset="utf-8"></script>
2.js中调用验证
<script type="text/javascript"> $(document).ready(function(){ $("#jvForm").validationEngine(); }); </script>
3.页面中添加相关的css
<form id="jvForm" class="form" action="updatePwd.jspx" method="post"> <input type="hidden" value="${userId}" name="userId" /> <div class="rowElem"><label>新密码:</label><input type="password" name="password" class="validate[required]"/></div> <div class="rowElem"><label>确认新密码:</label><input type="password" name="repassword" class="validate[required]"/></div> <div class="rowElem"><label></label><input type="submit" value="提交" /></div>
</form>