1. 自己定义验证--成功提示



1) 加入选项

errorClass: "unchecked"。
validClass: "checked",
errorElement: "span",
errorPlacement: function (error, element) {
if (element.parent().find("span[for=""" + element.attr("id") + """]") != null) {
element.parent().find("span[for=""" + element.attr("id") + """]").remove();
}
error.appendTo(element.parent());
},
success: function (label) {
label.removeClass("unchecked").addClass("checked");
},

2)设置样式

input.unchecked{border: 1px #E6594E dotted;}
span.checked {
padding: 3px 5px 3px 21px;margin-left: 10px;margin-top: 0px;margin-bottom: 3px;adisplay: inline;
height: 25px;line-height: 1px;font-size: 12px;aborder: 1px solid #E6594E;white-space: nowrap;
text-align: left;color: #E6594E;background:url("/Common/Sys/Cfg/images/checked.gif") no-repeat 3px;/* #FCEAE8 */
}
span.unchecked {
padding: 3px 5px 3px 21px;margin-left: 10px;margin-top: 0px;margin-bottom: 3px;adisplay: inline;
height: 25px;line-height: 1px;font-size: 12px;border: 1px solid #E6594E;white-space: nowrap;
text-align: left;color: #E6594E;background: #FCEAE8 url("/Common/Sys/Cfg/images/unchecked.gif") no-repeat 3px;
}

2. 自己定义验证--择要提示



1) 加入选项

errorContainer: container,
errorLabelContainer: $("ul"。 container),
wrapper: ""li"",
meta: "validate",
errorClass: "unchecked",
validClass: "checked",

2) 设置样式

input.unchecked{border: 1px #E6594E dotted;}
span.checked {
padding: 3px 5px 3px 21px;margin-left: 10px;margin-top: 0px;margin-bottom: 3px;adisplay: inline;
height: 25px;line-height: 1px;font-size: 12px;aborder: 1px solid #E6594E;white-space: nowrap;
text-align: left;color: #E6594E;background:url("/Common/Sys/Cfg/images/checked.gif") no-repeat 3px;/* #FCEAE8 */
}
span.unchecked {
padding: 3px 5px 3px 21px;margin-left: 10px;margin-top: 0px;margin-bottom: 3px;adisplay: inline;
height: 25px;line-height: 1px;font-size: 12px;border: 1px solid #E6594E;white-space: nowrap;
text-align: left;color: #E6594E;background: #FCEAE8 url("/Common/Sys/Cfg/images/unchecked.gif") no-repeat 3px;
}
div.container {
background-color: #eee;
border: 1px solid red;
margin: 5px;
padding: 5px;
}
div.container ol li {
list-style-type: disc;
margin-left: 20px;
}
div.container { display: none }
.container label.error {
display: inline;
}

3) 加入择要标识表记标帜

<div class="container">
<h4>There are serious errors in your form submission, please see below for details.</h4>
<ul></ul>
</div>

最新文章

  1. asp.net Application、 Session、Cookie、ViewState、Cache、Hidden 的区别
  2. HTTP的报文与状态码
  3. spring MVC配置详解
  4. python数字图像处理(5):图像的绘制
  5. Spring系列: 使用aop报错:nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$Refle
  6. NOIP2014 day2 T2 洛谷P2296 寻找道路
  7. 利用JBoss漏洞拿webshell方法
  8. OpenCV码源笔记——RandomTrees (一)
  9. OC学习笔记[注意事项]
  10. VS2010+Opencv-2.4.9的配置攻略
  11. php 回调函数
  12. hdu4355 三分
  13. TreeMap与TreeSet
  14. python连接mysql、oracle小例子
  15. java中抽象类的概念
  16. 网站开发进阶(四十三)html中,路径前加“/” 与不加“/”的区别
  17. Python实现微信消息防撤回
  18. ASP.NET Core教程【二】从保存数据看Razor Page的特有属性与服务端验证
  19. HDU5470 Typewriter SAM 动态规划 单调队列
  20. Luogu P2827 蚯蚓

热门文章

  1. CAD交互绘制矩形框(com接口)
  2. vue脚手架引入swiper
  3. 面试之Redis
  4. vue cli本地开发跨域问题解决
  5. [Algorithm] 1. A+B Problem
  6. 笔试算法题(34):从数字序列中寻找仅出现一次的数字 &amp; 最大公约数(GCD)问题
  7. Memcache 分布式存储 【一致性Hash】crc32
  8. aggregate和annotate方法使用详解与示例
  9. MySQL-----连表
  10. 集训第五周动态规划 J题 括号匹配