jquery validate的漂亮css樣式驗證,jqueryvalidate

來源:互聯網
上載者:User

jquery validate的漂亮css樣式驗證,jqueryvalidate

自己結合了在網上找的驗證功能和漂亮的提示同能後做出來的驗證 希望大家喜歡

頁面代碼代碼  
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  2. <HTML xmlns="http://www.w3.org/1999/xhtml">  
  3. <HEAD><TITLE>滑鼠移至上方 - 蘋果·志 - goldapple's blog</TITLE>  
  4. <META http-equiv=Content-Type content="text/html; charset=utf-8">  
  5. <STYLE type=text/css>  
  6. BODY {  
  7.     FONT-SIZE: 12px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif  
  8. }  
  9.  {  
  10.     PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px  
  11. }  
  12. A {  
  13.     DISPLAY: block; WIDTH: 164px; COLOR: #000000; HEIGHT: 36px; TEXT-DECORATION: none  
  14. }  
  15. UL {  
  16.     MARGIN: 200px auto; WIDTH: 632px; LIST-STYLE-TYPE: none  
  17. }  
  18. LI {  
  19.      FLOAT: left; MARGIN: 0px 20px; WIDTH: 164px; LINE-HEIGHT: 39px; POSITION: relative; HEIGHT: 36px; TEXT-ALIGN: center  
  20. }  
  21. LABEL {  
  22.     DISPLAY: none; BACKGROUND: url(images/hover.gif) no-repeat 0px 0px; LEFT: -16px; WIDTH: 200px; LINE-HEIGHT: 68px; POSITION: absolute; TOP: -100px; HEIGHT: 76px  
  23. }  
  24. input.error{  
  25. border: 2px dashed red;  
  26. }  
  27. </STYLE>  
  28.   
  29. <SCRIPT src="images/jquery.min.js" type=text/javascript></SCRIPT>  
  30. <SCRIPT src="jquery.validate.js" type=text/javascript></SCRIPT>  
  31. <SCRIPT type=text/javascript>  
  32.       
  33.           
  34. $(function(){  
  35.           
  36.               
  37.           
  38.               
  39.   $('#a input').hover(function(){  
  40.                           
  41.     $(this).parent().find('label').animate({opacity:"show",left:"-85px"},500);//.show();  
  42.    },function(){  
  43.                               
  44.    $(this).parent().find('label').animate({opacity:"hide",left:"-105px"},500);//.hide();  
  45.    });    
  46.       
  47.      
  48.      
  49.      
  50.    $("#signupForm").validate({  
  51.         
  52.         rules: {  
  53.                password: {  
  54.                 required: true,  
  55.                 minlength: 5  
  56.                },  
  57.                name:{  
  58.                  required:true  
  59.                }  
  60.   },  
  61.         messages: {  
  62.            password: {  
  63.             required: "請輸入密碼",  
  64.             minlength: jQuery.format("密碼不能小於{0}個字元")  
  65.            },  
  66.            name:{  
  67.              required:"測試"  
  68.            }  
  69.   },success:function(){  
  70.    $("label.error").remove();  
  71.   }  
  72.     });  
  73.      
  74.   
  75. })  
  76.           
  77.   
  78.   
  79.   
  80.   
  81.   
  82. </SCRIPT>  
  83.   
  84. <META content="MSHTML 6.00.2900.5803" name=GENERATOR></HEAD>  
  85. <BODY>  
  86. <form id="signupForm">  
  87. <div id="a">  
  88. <UL>  
  89.   <LI><div><input type="text" name="password"></div> </LI>  
  90.   <LI><input type="text" name="name"> </LI>  
  91. </UL>  
  92. </div>  
  93. </form>  
  94. </BODY></HTML>  

 

  • jquery_validate漂亮的驗證.zip (323 KB)
  • 下載次數: 680
  • jquery_validator漂亮的css驗證.zip (

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.