亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

jqueryFormvalidator Ajax修改數據驗證是否存在

發布時間:2020-05-29 03:23:01 來源:網絡 閱讀:873 作者:kafeihouye 欄目:web開發

 

  1. var accErrorMsg = "請輸入客戶分類名稱"
  2. //表單數據驗證 
  3. $(function(){ 
  4.                 //$.formValidator.initConfig({formid:"myform",autotip:true});    
  5.         $.formValidator.initConfig({ 
  6.                     formid:"myform", 
  7.                     autotip:true 
  8.                 }); 
  9.                  
  10.                 $("#name").formValidator({ 
  11.                 onshow:"請輸入客戶分類名稱", 
  12.                 onfocus:"2至20個字符", 
  13.                 oncorrect:"輸入正確"}).functionValidator({ 
  14.                                         fun: function(){ 
  15.                                             var roleName = $("#name").val(); 
  16.                                             if(trim(roleName)=="") 
  17.                                             { 
  18.                                                  accErrorMsg = "請輸入客戶分類名稱"
  19.                                                  return accErrorMsg; 
  20.                                             }else if(trim(roleName).length==1 ||trim(roleName).length>20){ 
  21.                                                  accErrorMsg="2至20個字符"
  22.                                                  return accErrorMsg; 
  23.                                             } 
  24.                                             else 
  25.                                             {                                                
  26.                                                 return true; 
  27.                                             } 
  28.                                         } 
  29.                                     }).ajaxValidator({ 
  30.                                         type:"post", 
  31.                                         url: "${basePath}clientSortSTManage/clientSortST!isClientSortNameExist.action", 
  32.                                         datatype: "json", 
  33.                                         timeout: 3000,   
  34.                                         success: function(data) 
  35.                                         { 
  36.                                             //將老角色名與新角色名比較,如果一樣判為通過 
  37.                                             var oldName = $('#oldName').val(); 
  38.                                          
  39.                                             var rName = $('#name').val();    
  40.                                             if(oldName && oldName==rName) 
  41.                                             { 
  42.                                                 return true; 
  43.                                             }        
  44.                                          
  45.                                             //根據ajax返回結果判斷       
  46.                                             var correct = data.correct; 
  47.                                             if(correct) 
  48.                                             { 
  49.                                                 return true; 
  50.                                             } 
  51.                                             else 
  52.                                             { 
  53.                                                 return false; 
  54.                                             } 
  55.                                              
  56.                                              
  57.                                         },                               
  58.                                         error: function() 
  59.                                         { 
  60.                                             artalert("服務繁忙,請稍后再試!"); 
  61.                                         }, 
  62.                                         onerror : "客戶分類名稱已存在,請更換客戶分類名稱", 
  63.                                         onwait : "正在對客戶分類名稱進行校驗,請稍候…" 
  64.                                     }).defaultPassed(); 
  65. }) 

 

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

修武县| 白水县| 松桃| 湘西| 府谷县| 聂拉木县| 北辰区| 成安县| 青河县| 泗水县| 阿城市| 静海县| 新余市| 凯里市| 崇义县| 营山县| 涞源县| 镇江市| 花垣县| 凤山县| 康马县| 若羌县| 莫力| 扎鲁特旗| 宝应县| 伊春市| 盘锦市| 扎兰屯市| 临汾市| 泗水县| 西丰县| 岳普湖县| 合作市| 临澧县| 周宁县| 若羌县| 芦溪县| 永平县| 启东市| 达孜县| 赤峰市|