jquery.validate小注

來源:互聯網
上載者:User

標籤:style   blog   http   color   os   java   for   sp   div   

jquery.validate 遠程驗證備忘
1.message一定要寫到最前面,這樣提示資訊才能顯示自訂的提示;
2.validate.aspx頁面傳回值為true或false即可
1
<!DOCTYPE html"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>Validate Demo</title> 5 <script src="Scripts/jquery-1.10.1.min.js" type="text/javascript"></script> 6 <script src="Scripts/jquery.validate.js" type="text/javascript"></script> 7 </head> 8 <body> 9 <form id="myForm">10 <div>11 <input type="text" name="username" id="username" value="測試姓名" />12 </div>13 <div>14 <input type="password" name="password" value="測試密碼" />15 </div>16 <div>17 <input type="text" name="email" value="[email protected]" />18 </div>19 <div>20 <input type="submit" name="submitsss" value="提交" />21 </div>22 </form>23 <script type="text/javascript">24 $("#myForm").validate({25 messages: { email: { remote: "該用郵箱已經被註冊!"} },26 rules: {27 email: {28 required: true,29 email: true,30 remote: {31 url: "validate.aspx",32 type: "post"33 }34 }35 }36 });37 </script>38 </body>39 </html>

 

jquery.validate小注

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.