'; jQuery("#sidebar_inquiry_form #contactus_results_mesg").hide().html(outputdata).slideDown(); jQuery("#sidebar_inquiry_form #submit_btn_supplier_contact").attr("disabled", false); jQuery("#sidebar_inquiry_form #submit_btn_buyer_contact").attr("disabled", false); jQuery("#ajax-loader").hide(); }*/ // old mesg // if (msg == 0) { // //error found // jQuery("#sidebar_inquiry_form #submit_btn_supplier_contact").attr("disabled", true); // jQuery("#sidebar_inquiry_form #submit_btn_buyer_contact").attr("disabled", true); // jQuery('#error-mesg-s').show(); // jQuery('#sidebar_inquiry_form').hide(); // } // else { // //success // jQuery('#success-mesg-s').show(); // jQuery('#sidebar_inquiry_form').hide(); // } if(output.value !== 3 || output.error !== 1) { setTimeout(function () { jQuery('#slide-inner').css('left', '-320px'); jQuery('#sidebar-link').css('left', '0'); success = 0; }, 700); } document.getElementById("s_message").className = ""; document.getElementById("s_message").className = "form-control"; jQuery('#error-mesg-s').hide(); jQuery('#error_s').hide(); return true; }, error: function (XMLHttpRequest, textStatus, errorThrown) { jQuery("#sidebar_inquiry_form #submit_btn_supplier_contact").attr("disabled", false); jQuery("#sidebar_inquiry_form #submit_btn_buyer_contact").attr("disabled", false); },complete: function() { jQuery("#ajax-loader").hide(); }, }); } else { if(ma_message_form == ''){ jQuery('#sidebar_inquiry_form #error_msg').show(); return false; } } }); } // New code jQuery(function(){ jQuery('#sidebar_inquiry_form #ei_country').change( function() { country_chk(); get_phone_code(jQuery("#sidebar_inquiry_form #ei_country").val()); }); jQuery("#country_div").click(function(){ jQuery("#country_select_child").css("display","inline"); }); }); function country_chk(){ var countries_legal = [10,17,27,46,48,49,50,60,65,66,72,75,87,93,95,106,112,113,121,138,157,158,162,174,175,179,189,208]; var country_selected=jQuery("#sidebar_inquiry_form #ei_country").val(); //if china do select seller. if(country_selected == '38') { jQuery("#sidebar_inquiry_form #is_buyer_or_seller").val("2"); } if (country_selected != 38 && country_selected != 223 && country_selected != 150) { jQuery('#sidebar_inquiry_form #d_states').html(''); jQuery('#sidebar_inquiry_form #d_cities').html(''); jQuery(".form_body").css('height','450px'); return; } // selected_val = jQuery("#sidebar_inquiry_form #country>option:selected").val(); jQuery("#sidebar_inquiry_form #d_cities").hide(); if(country_selected == 38 || country_selected == 223 || country_selected == 150) { jQuery(".form_body").css('height','500px'); jQuery("#sidebar_inquiry_form #d_cities").show(); } jQuery("#sidebar_inquiry_form #d_states").show(); jQuery('#sidebar_inquiry_form #d_states').html(' '); jQuery.ajax({ type: "POST", url: "/ajax.php?action=signup.get_province&return=html", data: "param[country_id]=" + country_selected, success: function (o) { jQuery('#sidebar_inquiry_form #d_states').html(o); jQuery("#sidebar_inquiry_form #state_id").attr('required',true); jQuery('#sidebar_inquiry_form #state_id').addClass("form-control"); // jQuery('#state_id').attr('onfocus','jQuery(this).mouseup(function(evt) {evt.target.selected = true;jQuery(this).click();});'); jQuery(".inline_states select[id='state_id']").css('margin-bottom', '10px'); jQuery('#sidebar_inquiry_form #state_id').css("width", "180px"); jQuery('#sidebar_inquiry_form #state_id').change(function () { jQuery('#sidebar_inquiry_form #d_cities').html(''); jQuery('#sidebar_inquiry_form #d_cities').html(' '); if (jQuery('#sidebar_inquiry_form #state_id').val() <= 0) { jQuery('#sidebar_inquiry_form #d_cities').html(''); return; } jQuery.ajax({ type: "POST", url: "/ajax.php?action=signup.get_city_by_state&return=html", data: "param[state_id]=" + jQuery('#sidebar_inquiry_form #state_id').val() + "&param[city]=-1", success: function (o) { jQuery('#sidebar_inquiry_form #d_cities').html(o); jQuery("#sidebar_inquiry_form #city_id").attr('required',true); jQuery('#sidebar_inquiry_form #city_id').addClass("form-control"); jQuery('#sidebar_inquiry_form #city_id').css("width", "130px"); jQuery("#sidebar_inquiry_form #d_cities").show(); // jQuery('#sidebar_inquiry_form #city_id').change(function() { // if(jQuery('input#city_id').length > 0){ // jQuery('input#city_id').addClass('form-control'); // } // }); }, failure: function (o) { jQuery('#sidebar_inquiry_form #d_cities').html(''); } }); selected_val = jQuery("#sidebar_inquiry_form #country>option:selected").val(); selected_state = jQuery("#sidebar_inquiry_form #state_id>option:selected").val(); jQuery("#sidebar_inquiry_form #d_cities").hide(); if (selected_val == 38 || selected_val == 223 || selected_val == 150) { jQuery("#d_cities").show(); } }); } }); } function refresh_image_contactus(captcha) { var randomnumber=Math.floor(Math.random()*1001); var img_ins=document.getElementById(captcha); document.getElementById('sidebar_sid').value= randomnumber; img_ins.src="/functions/generateimage/generateimage.php?id="+randomnumber; }