91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

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

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

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

石台县| 香格里拉县| 建平县| 福安市| 永寿县| 五台县| 镇沅| 贡觉县| 广丰县| 方山县| 南溪县| 南木林县| 巴楚县| 南安市| 玉树县| 阿克陶县| 永川市| 东乡县| 巩义市| 会泽县| 张北县| 沈丘县| 西安市| 漳浦县| 龙江县| 宁蒗| 黑水县| 平江县| 芜湖县| 塔河县| 旬邑县| 浮梁县| 读书| 泸州市| 太仓市| 南充市| 砀山县| 华宁县| 抚顺市| 崇阳县| 左贡县|