学习网站:http://validform.rjboy.cn/
插件依赖于jQuery,如页面中已引用无需重复载入,引入代码置于页尾,提示样式根据交互需求自定义
STEP1.代码结构
<form method="GET" action="#" id="search_form"> <p> <input type="text" name="q" value="" datatype="*"/> </p> <p></p> <input class="hidden" type="submit" name="button" value="查 询"/> <input type="hidden" name="dosubmit" value="1" /> </form>
STEP2.资源引用
<script type="text/javascript" src="http://p.iwanshang.com/static/jquery/1.12.4/jquery.min.js"></script> <script src="http://p.iwanshang.com/static/validform/Validform_v5.3.2_min.js"></script> <script src="http://p.iwanshang.com/static/validform/Validform_Datatype.js"><!--进阶验证,按需引用--></script>
STEP3.页面中调用
<script type="text/javascript">
	/* 表单验证 */
	$(function(){
		$("#search_form").Validform({
			tiptype:2
		});
	})
</script>Copyright © 2017 万商云集UED . All Rights Reserved. 蜀ICP备12001963号-2