"; } str += ""; str += "Others"; str += "---------"; jQuery("#pm_member_form #industry_exit").val(selectvalue); jQuery("#pm_member_form #industry_exit").prepend(str); jQuery('#loading').hide(); } }); } function verfiy_email_exit(email) { if(email == "") { return; } jQuery.ajax({ type: "POST", url: "/index.php?action=widgets_signup_verify_email&return=json", data: jQuery("#pm_member_form").serialize(), dataType: "json", success: function(msg) {	if(msg.error == 1) { jQuery("#exit_intent_pm_email").removeClass("success"); jQuery("#exit_intent_pm_email").addClass("error"); jQuery("#exit_intent_error_e").text('').hide(); jQuery("#exit_intent_error_e").text(msg.description[0].msg).show(); } else { jQuery("#exit_intent_error_e").text('').hide(); jQuery("#exit_intent_pm_email").removeClass("error"); jQuery("#exit_intent_error_e").addClass("success");	}	} });	} jQuery(document).ready(function () { get_phone_code_intentform('223'); jQuery("#nothanks").click(function(){ jQuery(".exit_intent_modal_head").hide(); createCookie('pm_inquiry', 1 ,1); });	}); function call_pm_signup(uid) { var email = jQuery("#pm_member_form #pm_email").val(); verfiy_email_exit(email); pm_signup(); } //pm_signup(); exit_intent('0'); function refresh_image_exit(captcha) { var randomnumber=Math.floor(Math.random()*1001); var img_ins=document.getElementById(captcha); document.getElementById("exit_sid").value = randomnumber; img_ins.src="/functions/generateimage/generateimage.php?id="+randomnumber; } function pm_signup(param) { var success = 0; //jQuery("#submit_exit_intent").click(function (e) { // e.preventDefault(); // Storing Field Values In Variables var pm_name_form = document.getElementById("exit_intent_pm_name").value; var pm_email_form = document.getElementById("exit_intent_pm_email").value; var pm_contact_no_form = document.getElementById("exit_intent_pm_contact_no").value; var code = document.getElementById("exit_intent_phone1").value; var captcha = jQuery("#exit_intent_s_code").val(); var s_message = document.getElementById("exit_intent_s_message").value; var ei_country = document.getElementById("exit_intent_ei_country").value; var is_buyer_supplier = jQuery("#pm_member_form input[name=is_buyer_supplier]:checked").val(); var company = jQuery("#pm_member_form #exit_company").val(); var industry = jQuery('#pm_member_form #industry_exit :selected').val(); var product = jQuery('#pm_member_form #exit_product').val(); var url = jQuery('#pm_member_form #memberarea').val(); var pwd = jQuery('#pm_member_form #password').val(); var city_id = jQuery('#pm_member_form #city_id').val(); var state_id = jQuery('#pm_member_form #state_id').val(); var phone2 = jQuery('#pm_member_form #phone2').val(); var sid = jQuery('#pm_member_form #exit_sid').val(); if((jQuery("#pm_member_form input[name=is_buyer_supplier]:checked").val() == 1 ) || (jQuery("#pm_member_form input[name=is_buyer_supplier]:checked").val() == 2)) { var is_buyer_supplier = jQuery("#pm_member_form input[name=is_buyer_supplier]:checked").val(); jQuery('#exit_intent_error_n_isbuyer').hide(); success = 1; } else{ jQuery('#exit_intent_error_n_isbuyer').show(); success = 0; return false; } if(parseInt(param) === 0){ if (pwd === "") { jQuery("#pm_member_form #password").addClass("error"); jQuery('#exit_intent_error_pwd').show(); success = 0; return false; } else{ jQuery('#exit_intent_error_pwd').hide(); jQuery("#pm_member_form #password").removeClass("error"); success = 1; } } if(jQuery("#pm_member_form #password").length == 1 && jQuery("#pm_member_form #password").val().length < 6) { jQuery('#exit_intent_error_pwd').show(); jQuery('#pm_member_form #exit_intent_error_pwd').text("Password must have 6 or more characters."); jQuery("#pm_member_form #password").removeClass("error"); success = 0; return false; } else { jQuery('#exit_intent_error_pwd').hide(); jQuery('#pm_member_form #exit_intent_error_pwd').text(""); jQuery("#pm_member_form #password").removeClass("error"); success = 1; } /*if (state_id === "") { jQuery("#pm_member_form #state_id").addClass("error"); jQuery('#exit_intent_error_state_id').show(); success = 0; return false; } else{ jQuery('#exit_intent_error_state_id').hide(); jQuery("#pm_member_form #state_id").removeClass("error"); success = 1; } if (city_id === "") { jQuery("#pm_member_form #city_id").addClass("error"); jQuery('#exit_intent_error_city_id').show(); success = 0; return false; } else{ jQuery('#exit_intent_error_city_id').hide(); jQuery("#pm_member_form #city_id").removeClass("error"); success = 1; }*/ if (s_message === "") { jQuery("#pm_member_form #exit_intent_error_messsage").addClass("error"); jQuery('#pm_member_form #exit_intent_error_messsage').show(); success = 0; return false; } else{ jQuery('#pm_member_form #exit_intent_error_messsage').hide(); jQuery("#pm_member_form #exit_intent_error_messsage").removeClass("error"); success = 1; } // Conditions if (pm_name_form == "") { jQuery("#pm_member_form #exit_intent_pm_name").addClass("error"); jQuery('#exit_intent_error_n').show(); success = 0; return false; } else{ jQuery('#exit_intent_error_n').hide(); jQuery("#pm_member_form #exit_intent_pm_name").removeClass("error"); success = 1; } if (industry == 0) { jQuery("#pm_member_form input[name=is_buyer_supplier]").addClass("error"); jQuery('#exit_intent_error_industry').show(); success = 0; return false; /// return false; } else{ jQuery('#exit_intent_error_industry').hide(); jQuery("#pm_member_form #industry_exit").removeClass("error"); success = 1; } if(pm_contact_no_form == "") { jQuery('#exit_intent_error_p').show(); jQuery("#pm_member_form #exit_intent_pm_contact_no").addClass("error"); success = 0; return false; } else { jQuery('#exit_intent_error_p').hide(); jQuery("#pm_member_form #exit_intent_pm_contact_no").removeClass("error"); success = 1; } if(company == "") { jQuery('#exit_intent_error_company').show(); jQuery("#pm_member_form #exit_company").removeClass("error"); success = 0; return false; } else { jQuery('#exit_intent_error_company').hide(); jQuery("#pm_member_form #exit_company").addClass("form-control"); success = 1; } if(product == "") { jQuery('#pm_member_form #exit_intent_error_product').show(); jQuery('#pm_member_form #exit_intent_error_industry').show(); jQuery("#pm_member_form #exit_product").removeClass("error"); jQuery("#pm_member_form #exit_intent_error_industry").removeClass("error"); success = 0; return false; } else { jQuery('#pm_member_form #exit_intent_error_product').hide(); jQuery('#pm_member_form #exit_intent_error_industry').hide(); jQuery("#pm_member_form #exit_product").addClass("form-control"); jQuery("#pm_member_form #exit_intent_error_industry").addClass("form-control"); success = 1; } if(parseInt(industry) == 0) { jQuery('#exit_intent_error_industry').show(); jQuery("#pm_member_form #industry_exit").removeClass("error"); success = 0; return false; } else { jQuery('#exit_intent_error_industry').hide(); jQuery("#pm_member_form #industry_exit").addClass("form-control"); success = 1; } if(captcha == "") { jQuery('#exit_error_captcha').show(); jQuery("#pm_member_form #exit_intent_s_code").removeClass("error"); success = 0; return false; } else { jQuery('#exit_error_captcha').hide(); jQuery("#pm_member_form #exit_intent_s_code").addClass("form-control"); success = 1; } if (pm_email_form == "") { var founde = jQuery('#exit_intent_pm_email').hasClass('form-control'); if (founde.length > 0) { } else { document.getElementById("exit_intent_pm_email").className += " error "; } jQuery('#exit_intent_error_e').show(); success = 0; return false; } else { if(!check_email(pm_email_form)) { var founde = jQuery('#exit_intent_pm_email').hasClass('form-control'); if (founde.length > 0) { } else { document.getElementById("exit_intent_pm_email").className += " error "; } jQuery('#exit_intent_error_e').show(); success = 0; return false } else { jQuery('#exit_intent_error_e').hide(); document.getElementById("exit_intent_pm_email").className = ""; document.getElementById("exit_intent_pm_email").className = "form-control"; success = 1; } } if (success == 1) { var version = undefined; var pm_email = pm_email_form; var pm_name = pm_name_form; var pm_contact_no = pm_contact_no_form; var action = jQuery("#pm_member_form #action").val() var signup_data = "&password="+pwd+"&pm_email=" + pm_email + "&pm_name=" + pm_name + "&pm_contact_no="+ pm_contact_no + "&city_id=" + city_id + "&state_id=" + state_id + "&phone2=" + phone2 + "&ei_country=" + ei_country + "&action=" + action+ "&phone1=" + code+ "&code=" + captcha+"&s_message="+s_message+"&is_buyer_supplier="+is_buyer_supplier+"&product="+product+"&sid="+sid+"&company="+company+"&industry="+industry; jQuery("#ajax-loader").show(); jQuery.ajax({ type: "POST", url: "/index.php?action=widgets_common_exit_intent&return=json", data: signup_data, dataType: "json", success: function (msg) { if (msg.value == 0) { //error found jQuery("#pm_member_form #submit").attr("disabled", true); jQuery('#error-mesg-e').show(); jQuery('#pm_member_form').hide(); jQuery('#success-mesg-e').show(); jQuery('#pm_member_form').hide(); jQuery('.modal-footer').hide(); createCookie('pm_inquiry', 1 ,120); refresh_image_exit('exit_signup_image_captcha'); } else if(msg == 1) { //success jQuery('#error-mesg-e').hide(); jQuery('#success-mesg-e').show(); jQuery('#pm_member_form').hide(); jQuery('.modal-footer').hide(); createCookie('pm_inquiry', 1 ,120); //window.location = url; } else if(msg.value == 1) { //success jQuery('#error-mesg-e').hide(); jQuery('#success-mesg-e').show(); jQuery('#pm_member_form').hide(); jQuery('.modal-footer').hide(); createCookie('pm_inquiry', 1 ,120); window.location = url; } else { var textValue = ''; jQuery.each(msg, function(i, val) { textValue += val+"