真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

jQuery插進tooltip提示和validate

  1.  
  2.      

validate.js

創(chuàng)新互聯(lián)公司專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于網(wǎng)站建設(shè)、成都做網(wǎng)站、儋州網(wǎng)絡(luò)推廣、重慶小程序開發(fā)公司、儋州網(wǎng)絡(luò)營銷、儋州企業(yè)策劃、儋州品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎;創(chuàng)新互聯(lián)公司為所有大學(xué)生創(chuàng)業(yè)者提供儋州建站搭建服務(wù),24小時服務(wù)熱線:13518219792,官方網(wǎng)址:www.cdcxhl.com

 

  1. function AddAbroadTravel(){} 
  2.  
  3. $().ready(function() { 
  4.     $("#abroadtravelForm").validate({ 
  5.         submitHandler:function(form){ 
  6.             if(!AddAbroadTravel.validateSchedule()){ 
  7.                 return; 
  8.             } 
  9.             var form = document.getElementById("abroadtravelForm"); 
  10.             form.encding="application/x-www-form-urlencoded"; 
  11.             form.action = "/admin/abroadTravelAction!showAbroadTravel"; 
  12.             form.target = "_self"; 
  13.             form.submit(); 
  14.         }, 
  15.         rules: { 
  16.             "info.travelName": { 
  17.                 required: true, 
  18.                 minlength: 2, 
  19.                 maxlength: 100 
  20.             }, 
  21.             "info.travelDeparture": { 
  22.                 required: true 
  23.             }, 
  24.             "info.travelDestin": { 
  25.                 required: true 
  26.             }, 
  27.             "info.travelRoomUsers": { 
  28.                 required: false, 
  29.                 digits:true 
  30.             }, 
  31.             "info.travelOnePersonRoom": { 
  32.                 minlength: 0, 
  33.                 maxlength: 100 
  34.             }, 
  35.             "info.travelDiningViews": { 
  36.                 required: false, 
  37.                 minlength: 0, 
  38.                 maxlength: 25 
  39.             }, 
  40.             "info.travelHotel": { 
  41.                 required: false, 
  42.                 minlength: 0, 
  43.                 maxlength: 50 
  44.             }, 
  45.             "info.travelTouristGuide": { 
  46.                 required: false, 
  47.                 minlength: 0, 
  48.                 maxlength: 50 
  49.             }, 
  50.             "info.travelConditions": { 
  51.                 required: false, 
  52.                 minlength: 0, 
  53.                 maxlength: 50 
  54.             }, 
  55.             "info.travelPeriod": { 
  56.                 required: true, 
  57.                 digits:true 
  58.             }, 
  59.             "info.travelAccomCity": { 
  60.                 required: false, 
  61.                 minlength: 0, 
  62.                 maxlength: 50 
  63.             }, 
  64.             "info.travelFuelCosts": { 
  65.                 required: false, 
  66.                 minlength: 0, 
  67.                 maxlength: 250 
  68.             }, 
  69.             "info.travelLocalTax": { 
  70.                 required: false, 
  71.                 minlength: 0, 
  72.                 maxlength: 250 
  73.             }, 
  74.             "info.travelAirportConstrFee": { 
  75.                 required: false, 
  76.                 minlength: 0, 
  77.                 maxlength: 250 
  78.             }, 
  79.             "info.travelChildrenPrice": { 
  80.                 required: false, 
  81.                 minlength: 0, 
  82.                 maxlength: 250 
  83.             }, 
  84.             "info.travelPoints": { 
  85.                 required: false, 
  86.                 minlength: 0, 
  87.                 maxlength: 250 
  88.             }, 
  89.             "info.travelOtherOptions": { 
  90.                 required: false, 
  91.                 minlength: 0, 
  92.                 maxlength: 250 
  93.             }, 
  94.             "info.travelNotes": { 
  95.                 required: false, 
  96.                 minlength: 0, 
  97.                 maxlength: 250 
  98.             }, 
  99.             "info.travelCommitment": { 
  100.                 required: false, 
  101.                 minlength: 0, 
  102.                 maxlength: 250 
  103.             }, 
  104.             "info.travelDepaTime": { 
  105.                 required: true 
  106.             } 
  107.         } 
  108.     }); 
  109.     var initTravelDeparture = jQuery("#initTravelDeparture").val(); 
  110.     var initTravelDestin = jQuery("#initTravelDestin").val(); 
  111.      
  112.     if(!initTravelDeparture) 
  113.         initTravelDeparture = ""; 
  114.          
  115.     if(!initTravelDestin) 
  116.         initTravelDestin = ""; 
  117.          
  118.     linkage.init('travelDeparture_select_country','travelDeparture_select_city',initTravelDeparture); 
  119.     linkage.init('travelDestin_select_country','travelDestin_select_city',initTravelDestin); 
  120.  
  121. }); 
  122.  
  123. //上傳景點圖片 
  124. AddAbroadTravel.uploadImg = function(){ 
  125.     var imgPath = jQuery("#upload").val(); 
  126.     if(imgPath){ 
  127.         var form = document.getElementById("abroadtravelForm"); 
  128.         form.encding="multipart/form-data"; 
  129.         form.action = "/admin/abroadTravelImgAction"; 
  130.         form.target = "uploadImgFrame"; 
  131.         form.submit(); 
  132.     } 
  133. }; 
  134.  
  135. //刪除景點圖片 
  136. AddAbroadTravel.delImg = function(imgA){ 
  137.     jQuery(imgA.parentNode.parentNode).remove(); 
  138. }; 
  139.  
  140. //追加日程 
  141. AddAbroadTravel.addSchedule = function(){ 
  142.     var imgsTables = document.getElementById("scheduleTable"); 
  143.     var tr = imgsTables.insertRow(imgsTables.rows.length); 
  144.     var strHtml = ''; 
  145.     strHtml += '日觀光內(nèi)容:'; 
  146.     strHtml += ''; 
  147.     strHtml += ' 居住酒店:'; 
  148.     strHtml += '  '; 
  149.     strHtml += 'X'; 
  150.     tr.innerHTML = strHtml; 
  151.     jQuery('#div2 [title]').tipsy({trigger: 'focus',fade: true}); 
  152. }; 
  153.  
  154. //刪除日程 
  155. AddAbroadTravel.delSchedule = function(obj){ 
  156.     jQuery(obj.parentNode.parentNode).remove(); 
  157. }; 
  158.  
  159. //驗證日程 
  160. AddAbroadTravel.validateSchedule = function(){ 
  161.     var scheduleDays = jQuery("input[name='scheduleDay']"); 
  162.     var scheduleContents = jQuery("textarea[name='scheduleContent']"); 
  163.     var scheduleHotels = jQuery("input[name='scheduleHotels']"); 
  164.  
  165.     var i = 0; 
  166.     for(i = 0; i < scheduleDays.length; i++){ 
  167.         if(!FM.STRING.isNum(jQuery(scheduleDays[i]).val())){ 
  168.             jQuery(scheduleDays[i]).focus(); 
  169.             return false; 
  170.         } 
  171.     } 
  172.  
  173.     for(i = 0; i < scheduleContents.length; i++){ 
  174.         if(jQuery(scheduleContents[i]).val().length > 250){ 
  175.             jQuery(scheduleContents[i]).focus(); 
  176.             return false; 
  177.         } 
  178.     } 
  179.      
  180.     for(i = 0; i < scheduleHotels.length; i++){ 
  181.         if(jQuery(scheduleHotels[i]).val().length > 100){ 
  182.             jQuery(scheduleHotels[i]).focus(); 
  183.             return false; 
  184.         } 
  185.     } 
  186.     return true; 
  187. }; 

 

附件:http://down.51cto.com/data/2358358

分享標(biāo)題:jQuery插進tooltip提示和validate
網(wǎng)頁鏈接:http://weahome.cn/article/giccgg.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部