Changeset 476243
- Timestamp:
- 12/16/2011 06:31:35 AM (14 years ago)
- File:
-
- 1 edited
-
wp-alicart/trunk/alicart_javascripts.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-alicart/trunk/alicart_javascripts.php
r476224 r476243 1 <?php1 <?php 2 2 function alicart_jquery_javascript() 3 3 { … … 39 39 <script type="text/javascript"> 40 40 <!--// 41 $().ready(function() { 42 $("form .inputtext:input").blur(function() { 43 var $parent = $(this).parent(); 41 jQuery.noConflict(); 42 43 jQuery().ready(function() { 44 jQuery("form .inputtext:input").blur(function() { 45 var $parent = jQuery(this).parent(); 44 46 $parent.find(".prompt").remove(); 45 47 46 if( $(this).is("#consignee")) {48 if(jQuery(this).is("#consignee")) { 47 49 if(this.value=="") { 48 50 var errorMsg = "请填写收款人姓名"; … … 51 53 } 52 54 53 if( $(this).is("#address")) {55 if(jQuery(this).is("#address")) { 54 56 if(this.value=="") { 55 57 var errorMsg = "请详细填写省/市/区/街道"; … … 58 60 } 59 61 60 if( $(this).is("#zip_code")) {62 if(jQuery(this).is("#zip_code")) { 61 63 if(this.value=="") { 62 64 var errorMsg = "请填写邮政编码"; … … 68 70 } 69 71 70 if( $(this).is(".phone")) {71 if( $("#phone_section").val()!="" || $("#phone_code").val()!="" || $("#phone_ext").val()!="") {72 if(isNaN($("#phone_section").val()) || $("#phone_section").val().length < 3 || $("#phone_section").val().length > 4 || isNaN($("#phone_code").val()) || $("#phone_code").val().length < 6 || $("#phone_code").val().length > 9 || isNaN($("#phone_ext").val())) {72 if(jQuery(this).is(".phone")) { 73 if(jQuery("#phone_section").val()!="" || jQuery("#phone_code").val()!="" || jQuery("#phone_ext").val()!="") { 74 if(isNaN($("#phone_section").val()) || $("#phone_section").val().length < 3 || jQuery("#phone_section").val().length > 4 || isNaN(jQuery("#phone_code").val()) || jQuery("#phone_code").val().length < 6 || jQuery("#phone_code").val().length > 9 || isNaN(jQuery("#phone_ext").val())) { 73 75 var errorMsg = "请填写正确的电话号码"; 74 76 $parent.append("<span class=\'prompt onError\'>"+errorMsg+"</span>"); … … 77 79 } 78 80 79 if( $(this).is("#mobile_phone")) {81 if(jQuery(this).is("#mobile_phone")) { 80 82 if(this.value != "") { 81 83 if(isNaN(this.value) || this.value.length != 11) { … … 87 89 88 90 }).keyup(function() { 89 $(this).triggerHandler("blur");91 jQuery(this).triggerHandler("blur"); 90 92 }).focus(function() { 91 $(this).triggerHandler("blur");93 jQuery(this).triggerHandler("blur"); 92 94 }); 93 95 94 $(".alicart_go_my_cart").click(function() {95 $("form .inputtext:input").trigger("blur");96 var errorNum = $("form .onError").length;96 jQuery(".alicart_go_my_cart").click(function() { 97 jQuery("form .inputtext:input").trigger("blur"); 98 var errorNum = jQuery("form .onError").length; 97 99 if(errorNum) { 98 100 return false;
Note: See TracChangeset
for help on using the changeset viewer.