"; } jQuery("#sidebar_inquiry_form #industry_contact").val(selectvalue); str += ""; str += "Others"; str += "---------"; jQueryNew("#sidebar_inquiry_form #industry_contact").prepend(str); //jQueryNew("#industry_contact option:first").attr('selected','selected'); } }); } function get_phone_code_side_bar(country) {	if(country == "") { return; } jQueryNew.ajax({ type: "POST", url: "/ajax.php?action=common.get_country_code&return=json", data: "country="+country, dataType: "json", beforeSend: function() { jQueryNew("#loading_code").show(); }, complete: function() { jQueryNew("#loading_code").hide(); }, success: function(msg) { /*if (!msg.description[0].msg) msg.description[0].msg = "1";*/ jQueryNew("#sidebar_inquiry_form #phone1").val(+msg.description[0].msg); } }); } function isNumberKey(evt){ var charCode = (evt.which) ? evt.which : evt.keyCode; if(charCode == 116){ return true; } return !(charCode > 31 && (charCode < 48 || charCode > 57)); } /*jQuery( "#sidebar_inquiry_form #submit_btn_buyer_contact" ).one( "click", function(e) { //e.stopImmediatePropagation(); SendBuyerPaidRequest(); }); jQuery( "#sidebar_inquiry_form #submit_btn_supplier_contact" ).one( "click", function(e) { //e.stopImmediatePropagation(); SendSupplierPaidRequest(); });*/ function SendSupplierPaidRequest(){ jQuery("#sidebar_inquiry_form #is_buyer_or_seller").val(2); s_inquiry_test_value(ajax_url); return false; } function SendBuyerPaidRequest(){ jQuery("#sidebar_inquiry_form #is_buyer_or_seller").val(1); s_inquiry_test_value(ajax_url); return false; } function s_inquiry_test_value(url_value) { jQuery("#sidebar_inquiry_form").submit(function (e) { e.preventDefault(); e.stopImmediatePropagation(); // Storing Field Values In Variables var ma_message_form = jQuery("#sidebar_inquiry_form #s_message").val(); // Conditions if (ma_message_form != '' || true) { jQuery('#slide-inner').css('left', '0'); jQuery('#sidebar-link').css('left', '320px'); var success = 1; var version = undefined; var pm_email = jQuery("#sidebar_inquiry_form #pm_email").val(); var is_buyer_or_seller = jQuery("#sidebar_inquiry_form #is_buyer_or_seller").val(); var show_captcha = jQuery("#sidebar_inquiry_form #show_captcha").val(); var product = jQuery("#sidebar_inquiry_form #product").val(); var industry = jQuery("#sidebar_inquiry_form #industry_contact").val(); var company = jQuery("#sidebar_inquiry_form #company").val(); var phone2 = jQuery("#sidebar_inquiry_form #phone2").val(); var pm_contact_no = jQuery("#sidebar_inquiry_form #contact_no").val(); var pm_name = jQuery("#sidebar_inquiry_form #name").val(); var s_message = jQuery("#sidebar_inquiry_form #s_message").val(); var phone1 = jQuery("#sidebar_inquiry_form #phone1").val(); var captcha = jQuery("#sidebar_inquiry_form #code").val(); var ei_country = jQuery("#sidebar_inquiry_form #ei_country").val(); var pm_reason = (jQuery("#sidebar_inquiry_form #pm_reason").val() != "") ? jQuery("#sidebar_inquiry_form #pm_reason").val() : "" ; var chat_messenger_select = (jQuery("#sidebar_inquiry_form #chat_messenger_select").val() != "") ? jQuery("#sidebar_inquiry_form #chat_messenger_select").val() : "" ; var chat_messenger = (jQuery("#sidebar_inquiry_form #chat_messenger").val() != "") ? jQuery("#sidebar_inquiry_form #chat_messenger").val() : "" ; var action = jQuery("#sidebar_inquiry_form #action").val(); var country_ids = jQuery("#sidebar_inquiry_form #country_ids").val(); var password = jQuery("#sidebar_inquiry_form #password").val(); var city_id = jQuery("#sidebar_inquiry_form #city_id").val(); var state_id = jQuery("#sidebar_inquiry_form #state_id").val(); var sid = jQuery("#sidebar_inquiry_form #sidebar_sid").val(); var signup_data = "pm_email=" + pm_email + "&is_buyer_or_seller=" + is_buyer_or_seller + "&show_captcha=" + show_captcha + "&product=" + product + "&industry=" + industry + "&company=" + company + "&phone2=" + phone2 + "&pm_contact_no=" + pm_contact_no + "&pm_name=" + pm_name+ "&s_message=" + s_message+ "&phone1=" + phone1+ "&code=" + captcha+ "&ei_country=" + ei_country+ "&pm_reason=" + pm_reason+ "&chat_messenger_select=" + chat_messenger_select+ "&chat_messenger=" + chat_messenger+ "&city_id=" + city_id+ "&state_id=" + state_id+ "&sid=" + sid + "&action="+action+"&password="+password;	// Conditions jQuery('#sidebar_inquiry_form #error_email').hide(); jQuery('#sidebar_inquiry_form #error_cnp').hide(); jQuery('#sidebar_inquiry_form #error_mp').hide(); jQuery('#sidebar_inquiry_form #error_msg').hide(); jQuery('#sidebar_inquiry_form #error_captcha').hide(); if(!validateEmail(pm_email)){ jQuery('#sidebar_inquiry_form #error_email').show(); success = 0; } else{ jQuery('#sidebar_inquiry_form #error_email').hide(); } if(pm_name == "") { jQuery('#sidebar_inquiry_form #error_name').show(); success = 0; }else{ jQuery('#sidebar_inquiry_form #error_name').hide(); } if(product == "") { jQuery('#sidebar_inquiry_form #error_prod').show(); success = 0; }else{ jQuery('#sidebar_inquiry_form #error_prod').hide(); } if(is_buyer_or_seller == '2') { if(company == "") { jQuery('#sidebar_inquiry_form #error_cnp').show(); success = 0; }else{ jQuery('#sidebar_inquiry_form #error_cnp').hide(); } } if(pm_email == "undefined" || pm_email == "" ) { jQuery('#sidebar_inquiry_form #error_email').show(); success = 0; } if(pm_contact_no == "") { jQuery('#sidebar_inquiry_form #error_mp').show(); success = 0; }else{ jQuery('#sidebar_inquiry_form #error_mp').hide(); } if(industry == 0 || industry == '') { jQuery('#sidebar_inquiry_form #error_industry').show(); success = 0; } else { jQuery('#sidebar_inquiry_form #error_industry').hide(); } if(s_message == 0 || s_message == '') { jQuery('#sidebar_inquiry_form #error_msg').show(); success = 0; } else { jQuery('#sidebar_inquiry_form #error_msg').hide(); } if(captcha == ''){ jQuery('#sidebar_inquiry_form #error_captcha').show(); success = 0; } else { jQuery('#sidebar_inquiry_form #error_captcha').hide(); } if(password == ''){ jQuery('#sidebar_inquiry_form #error_password').show(); success = 0; } else { jQuery('#sidebar_inquiry_form #error_password').hide(); } if(verfiy_email_contact(pm_email) == false) { success = 0; } if(success == 0){ return 0; } /*if(pm_email_form == "") { jQuery('#sidebar_inquiry_form #error_e').show(); success = 0; }*/ //var signup_data = "&password="+password+"s_chat=" + chat_messenger_select + "&s_message=" + s_message + "&s_contact_no=" + s_contact_no + "&action=" + action; jQuery("#ajax-loader").show(); jQuery.ajax({ type: "POST", url: url_value, data: signup_data, dataType: "json", success: function (output) { var error = true; if(output["password"] == "password"){ jQuery('#sidebar_inquiry_form #error_password').show(); error = (error == false) ? false : true; } if(output["pm_name"] == "pm_name"){ jQuery('#sidebar_inquiry_form #error_name').show(); error = false; } if(output["pm_email"] == "pm_email"){ jQuery('#sidebar_inquiry_form #error_email').text(output["pm_email"]).show(); error = false; } if(output["pm_contact_no"] == "pm_contact_no"){ jQuery('#sidebar_inquiry_form #error_mp').show(); error = false; } if(output["company"] == "company"){ jQuery('#sidebar_inquiry_form #error_cnp').show(); error = false; } if(output["industry_contact"] == "industry_contact"){ jQuery('#sidebar_inquiry_form #error_industry').show(); error = false; } if(output["product"] == "product"){ jQuery('#sidebar_inquiry_form #error_prod').show(); error = false; } if(error == false){ return false; } /*var outputdata = '