**特效介绍:** 一行代码搞定整站的表单验证 Validform就是一款开源的第三方验证js的控件,通过添加相应的js以及css能够有效的验证表单,维护起来也很方便。 **使用说明:** 头部插入js和css: ~~~ <script src='{cms:sitepath}js/jquery.min.js' type='text/javascript'></script> <link href='{cms:sitepath}plugins/Validform/Validform.css' rel='stylesheet'/> <script src='{cms:sitepath}plugins/Validform/Validform.min.js'></script> ~~~ ~~~ <form class="registerform" action="post.asp"> <div class="formsub"> <ul> <li> <label><span class="need">*</span> 昵称:</label> <input type="text" value="" name="name" class="inputxt" datatype="s6-18" errormsg="昵称至少6个字符,最多18个字符!" /> <div class="Validform_checktip">昵称为6~18个字符</div> </li> <li> <label><span class="need">*</span> 密码:</label> <input type="password" value="" name="userpassword" class="inputxt" datatype="*6-16" nullmsg="请设置密码!" errormsg="密码范围在6~16位之间!" /> <div class="Validform_checktip">密码范围在6~16位之间</div> </li> <li> <label><span class="need">*</span> 确认密码:</label> <input type="password" value="" name="userpassword2" class="inputxt" datatype="*" recheck="userpassword" nullmsg="请再输入一次密码!" errormsg="您两次输入的账号密码不一致!" /> <div class="Validform_checktip">两次输入密码需一致</div> </li> </ul> <div class="action"> <input type="submit" value="提 交" /> <input type="reset" value="重 置" /> </div> </div> </form> ~~~ ~~~ <script type="text/javascript"> $(function(){ $(".registerform").Validform({tiptype:function(msg,o,cssctl){if(!o.obj.is("form")){var objtip=o.obj.siblings(".Validform_checktip");cssctl(objtip,o.type);objtip.text(msg);}}}); }) </script> ~~~ **插件演示:** http://validform.rjboy.cn/demo/demo_normal_notable.html