zoukankan      html  css  js  c++  java
  • Jquery validate格式

    1.jquery.js ,jquery.valiate.js引入;

    2.验证信息的样式,参考:

    label.error{color:#ea5200; margin-left:4px; padding:0px 20px; background:url(images/unchecked.gif) no-repeat 2px 0 }
    label.right{margin-left:4px; padding-left:20px; background:url(images/checked.gif) no-repeat 2px 0}

    3.验证的格式:

    $(function(){

      var validate= $("选择器").validate({

        rules:{},

        messages{},

        errorPlacement: function(error, element){},//一般为:  error.insertAfter(element);

        success:function(label){} //一般为:label.html(" ").addClass("right");

      });

    )

    当需要ajax取数据时用remote:

    remote:{

      url:"Servlet类",

      type:"get/post",

      data:{

        如:

               username:function(){

          return $("username").val();//即使有中文,也不要在这里转码,到servlet里去转,servlet返回的是boolean值

        }

      }

    }

  • 相关阅读:
    Fibonacci Again
    N的10000的阶乘
    HDU2141(二分搜索)
    POJ2366(HASH法)
    10106 Product
    UVA 401 Palindromes
    UVA424 Integer Inquiry
    POJ2503(二分搜索)
    mysql重置root密码
    tidb安装haproxy负载均衡
  • 原文地址:https://www.cnblogs.com/yanjunwu/p/2689890.html
Copyright © 2011-2022 走看看