Home > Web Front-end > JS Tutorial > body text

基于jQuery.Validate验证库知识点的详解_jquery

WBOY
Release: 2016-05-16 17:35:16
Original
1032 people have browsed it
1、如果设置了errorContainer、errorLabelContainer、wrapper,则errorPlacement不起作用
复制代码 代码如下:

...
  $(document).ready(function(){
    $("#myform").validate({
       errorContainer: "#messageBox1, #messageBox2",
       errorLabelContainer: "#messageBox1 ul",
       wrapper: "li",
       debug:true,
...

errorContainer: 可以配置多个容器,这里的messageBox2元素没有被包装处理,只是错误发生的时候显示和隐藏此元素

errorLabelContainer:显示错误信息的容器,根据校验结果隐藏或者显示错误容器。

wrapper: 显示错误信息的外层标签名称.

errorElement: 指定显示校验错误信息的html标签名称(默认为label)

比如errorElement设置为span的情况


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!