var flag = false; function formValidation (event){ if(event.currentTarget.id == 'nri_choice1'){ return true; }else if(event.currentTarget.name == 'full_name') { return !fullnameValidation(event); }else if(event.currentTarget.name == 'full_name2') { return !fullnameValidation(event); }else if(event.currentTarget.name == 'full_name1') { return !fullnameValidation(event); }else if(event.currentTarget.name == 'fname') { return !fullnameValidationWithoutSpace(event); }else if(event.currentTarget.name == 'acc_number'){ return !checkAccountNum(event); }else if(event.currentTarget.name == 'mobile_number'){ return !checkMobileNRI(event); }else if(event.currentTarget.name == 'mobile_number_alt'){ return !checkaltMobile(event); } else if(event.currentTarget.name == 'email'){ return !checkEmail(event); } /*else if(event.currentTarget.name == 'email1'){ return !checkEmail(event); }*/ else if(event.currentTarget.name == 'email3'){ return !checkEmail(event); }else if(event.currentTarget.name == 'mobile1'){ return !checkMobile(event); } // else if(event.currentTarget.name == 'pincode'){ // return !checkZipcode(event); // } else if(event.currentTarget.name == 'pincode2'){ return !checkZipcode(event); }else if(event.currentTarget.name == 'mobile2'){ return !checkMobile(event); }else if(event.currentTarget.name == 'emp_name') { return !commonValidation(event); }else if(event.currentTarget.name == 'pl_home_emp_name') { return !commonValidation(event); } else if(event.currentTarget.name == 'gross_income') { return !checkGrossIncome(event); }else if(event.currentTarget.name == 'current_yr_tax_income') { return !commonValidation(event); }else if(event.currentTarget.name == 'gross_turnover') { return !commonValidation(event); }else if(event.currentTarget.name == 'current_depreciation') { return !commonValidation(event); }else if(event.currentTarget.name == 'current_tax') { return !commonValidation(event); }else if(event.currentTarget.name == 'prev_tax_income') { return !commonValidation(event); }else if(event.currentTarget.name == 'emi_amt') { return !commonValidation(event); }else if(event.currentTarget.name == 'pl_loan_amt') { return !commonValidation(event); } } function checkEmail(event){ var email = event.currentTarget.value.trim(); if(email === '') { $('.emailErr').css('display', 'block').text('Email address must not be blank'); $(".next-btn").hide(); return false; }else if(emailValidation(email) === false) { $('.emailErr').css('display', 'block').text('Invalid email address'); $(".next-btn").hide(); return false; }else { $('.emailErr').css('display', 'none'); $(".next-btn").show(); } return true; } function fullnameValidationWithoutSpace(event){ var fullname = event.currentTarget.value.trim(); var regName = /^[a-zA-Z]+$/; if(fullname === '') { $('.fullnameErr').css('display', 'block').text('Full Name must not be blank'); $(".next-btn").hide(); return false; }else { $('.fullnameErr').css('display', 'none'); //$(".next-btn").show(); } return true; } function fullnameValidation(event){ var fullname = event.currentTarget.value.trim(); var regName = /^[a-zA-Z]+ [a-zA-Z]+$/; if(fullname === '') { $('.fullnameErr').css('display', 'block').text('Full Name must not be blank'); $(".next-btn").hide(); return false; } /*else if(!regName.test(fullname)) { $('.fullnameErr').css('display', 'block').text('Please enter your full name (first & last name)'); $(".next-btn").hide(); $('#full_name').focus(); return false; }*/ else { $('.fullnameErr').css('display', 'none'); //$(".next-btn").show(); } return true; } function validatePincode(pin,ptype,weburl){ console.log('in p fun'+ptype); if(ptype=="CC"){ var btnsubmit ="cc_first_submit"; var productName ="Credit Card"; }else if(ptype=="PL"){ var btnsubmit ="submit_pl_first"; var productName ="Personal Loan"; var income =$('#pl_gross_income').val(); }else if(ptype=="PLOFFER"){ //var btnsubmit ="submit_plpromo_first"; var productName ="Personal Loan"; var chkpl =ptype; var ptype ="PL"; } if(pin==""){ alert('Please enter pincode'); return false; }else{ var data = "pincode="+pin+"&post_type=pin&p="+ptype+"&sal="+income; $.ajax({ url:"https://apply.standardchartered.co.in/apis/form-api-general/", type: 'GET', data: data, dataType: "json", success:function(response){ console.log(response); if(response.status=="2"){ alert("Thank you for your interest in a Standard Chartered "+productName+". We regret to inform you, that we are unable to proceed with your application as it does not meet the prescribed policy requirements."); if(chkpl=="PLOFFER"){ $("#pincode_promo").val(""); }else{ $('.'+btnsubmit).attr("disabled", "true"); $('.'+btnsubmit).addClass("btngrey"); $('.next-btn').attr("disabled", "true"); } //return false; flag=false; }else{ $("#city").val(response.city); $("#state").val(response.state); $("#initiatedby").val(response.initiatedby); $('.next-btn').removeClass("btngrey"); $('.next-btn').attr("disabled", false); flag=true; } }, error:function(error){ console.log(error); } }); console.log("FINAL FLag"+flag); return flag; } } function checkZipcode(event){ var pincode = event.currentTarget.value.trim(); var pincodeid = event.currentTarget.id.trim(); var zipregex = /^\d{6}$/ if(pincode === '') { $('.pinErr').css('display', 'block').text('Zip must not be blank'); $(".next-btn").hide(); return false; }else if(!pincode.match(zipregex)) { $('.pinErr').css('display', 'block').text('Zipcode must have six digits'); $(".next-btn").hide(); return false; }else { if(pincode.length==6){ console.log("pin"+pincode.length); var dataid =$("#"+pincodeid).attr("data-id"); validatePincode(pincode,dataid,root); } $('.pinErr').css('display', 'none'); //$(".next-btn").show(); } return true; } $('.chkpincode').on('change', function(){ var pincode =$(this).val(); var dataid =$(this).attr("data-id"); if(pincode.length==6){ //console.log("pinCC"+pincode.length); validatePincode(pincode,dataid,root); } }); function checkGrossIncome(event){ var grossincome = event.currentTarget.value.trim(); if(grossincome === '') { $('.commonErr').css('display', 'block').text('Gross income must not be blank'); $(".next-btn").hide(); return false; }else if(grossincome <=25000) { // $('.commonErr').css('display', 'block').text('Gross income must be'); //alert('Thank you for your interest in Standard Chartered Personal Loan. We regret to inform you that we are unable to proceed with your application process at this point in time our internal policy guidelines. Please check and submit in case you have entered anything incorrectly.') alert("Thank you for your interest in a Standard Chartered Personal Loan. We regret to inform you, that we are unable to proceed with your application as it doesn’t meet the prescribed policy requirements.") //window.location.href="https://imedia.iprospect.co/in/onlineleads/personal-loan/"; $(".next-btn").hide(); return false; }else { $('.commonErr').css('display', 'none'); //$(".next-btn").show(); } return true; } function checkVerify(event, code) { var verify = event.currentTarget.value.trim(); if(verify === '') { $('.verifyErr').css('display', 'block').text('Please enter Captcha'); return false; }else if(verify !== code){ $('.verifyErr').css('display', 'block').text('Captcha does not matched!'); return false; } else { $('.verifyErr').css('display', 'none'); } return true; } function checkAccountNum(event) { var account_number = event.currentTarget.value.trim(); if(account_number === '') { $('.accErr').css('display', 'block').text('Account Number must not be blank'); $(".next-btn").hide(); return false; }else { $('.accErr').css('display', 'none'); //$(".next-btn").show(); } return true; } $('#chkauth1,#chktc1,#chkauth,#chktc').click(function(){ var dnd_check = $('#chkauth1').is(':checked'); var term_cond = $('#chktc1').is(':checked'); var dnd_check_1 = $('#chkauth').is(':checked'); var term_cond_1 = $('#chktc').is(':checked'); if((dnd_check == true && term_cond == true) || (dnd_check_1 == true && term_cond_1 == true)){ $('.submit_pl_first').removeAttr("disabled"); $('.submit_pl_first').removeClass("btngrey"); }else { //alert('Check DND/NDNC* and Terms and Condition !!'); $('.submit_pl_first').attr("disabled", "true"); $('.submit_pl_first').addClass("btngrey"); } }); $('#chkauth_cc1,#chktc_cc1,#chkauth_cc2,#chktc_cc2,#chkauth_cc3,#chktc_cc3').click(function(){ var chkauth_cc1 = $('#chkauth_cc1').is(':checked'); var chktc_cc1 = $('#chktc_cc1').is(':checked'); var chkauth_cc2 = $('#chkauth_cc2').is(':checked'); var chktc_cc2 = $('#chktc_cc2').is(':checked'); var chkauth_cc3 = $('#chkauth_cc3').is(':checked'); var chktc_cc3 = $('#chktc_cc3').is(':checked'); if((chkauth_cc1 == true && chktc_cc1 == true) || (chkauth_cc2 == true && chktc_cc2 == true) ||(chkauth_cc3 == true && chktc_cc3 == true)){ $('.cc_first_submit').removeAttr("disabled"); $('.cc_first_submit').removeClass("btngrey"); }else { //alert('Check Terms and Condition and Credit Bureau Check * !!'); $('.cc_first_submit').attr("disabled", "true"); $('.cc_first_submit').addClass("btngrey"); } }); function checkMobile(event){ var mobile = event.currentTarget.value.trim(); var phno = /^\d{10}$/ // $('.submit_pl_first').prop('disabled', true); if(mobile === '') { $('.mblErr').css('display', 'block').text('Mobile must not be blank'); $('.submit_pl_first').prop('disabled', true); $(".next-btn").hide(); return false; }else if(!mobile.match(phno)) { $('.mblErr').css('display', 'block').text('Invalid mobile number'); $(".next-btn").hide(); return false; }else { $('.mblErr').css('display', 'none'); $(".next-btn").show(); } // $('.submit_pl_first').prop('disabled', false); return true; } function checkMobileNRI(event){ $('.mblErr').css('display', 'none'); var mobile = event.currentTarget.value.trim(); var phno = /^\d{10,16}$/; if(mobile === '') { $('.mblErr').css('display', 'block').text('Mobile must not be blank'); //$('.submit_pl_first').prop('disabled', true); $(".next-btn").hide(); return false; }else { $('.mblErr').css('display', 'none'); $("#mobile_input_next").show(); } /*else if(!mobile.match(phno)) { $('.mblErr').css('display', 'block').text('Invalid mobile number'); $(".next-btn").hide(); return false; }*/ return true; } function checkaltMobile(event){ var mobile = event.currentTarget.value.trim(); var phno = /^\d{10}$/ if(!mobile.match(phno)) { $('.altmblErr').css('display', 'block','top','20px').text('Invalid mobile number'); $(".next-btn").hide(); return false; }else { $('.altmblErr').css('display', 'none'); $("#mobile_input_next").show(); } return true; } function commonValidation(event) { var fieldname = event.currentTarget.value.trim(); if(fieldname === '') { $('.commonErr').css('display', 'block').text('Field should not be blank'); $(".next-btn").hide(); return false; }else { $('.commonErr').css('display','none'); //$(".next-btn").show(); } return true; } function emailValidation(email){ if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)) { return true; } return false; } function delay(callback, ms) { var timer = 0; return function() { var context = this, args = arguments; clearTimeout(timer); timer = setTimeout(function () { callback.apply(context, args); }, ms || 0); }; } function setCookie(cname, cvalue, exmin) { var d = new Date(); d.setTime(d.getTime() + (exmin*60*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i 57)){e.preventDefault();return false;}}) $(".alpha-only").on("keydown", function(event){ // Allow controls such as backspace, tab etc. var arr = [8,9,16,17,20,32,35,36,37,38,39,40,45,46]; // Allow letters for(var i = 65; i <= 90; i++){ arr.push(i); } // Prevent default if not in array if(jQuery.inArray(event.which, arr) === -1){ event.preventDefault(); } }); $("#other_id").change(function(){ $(".voter_details, .aadhar_details , .passport_details , .license_details").hide(); $("." + $(this).find(':selected').data('id')).show(); setCookie("otherId" , $(this).val() , 15); }); // $("#education , #pl_homepin").one('click',function(){ // $(".employment-bg").trigger("click"); // }); $("#ploff_income_other, #pl_app_gincome").one('focus',function(){ $(".identity-bg").trigger("click"); }); $('.add-income').on('change', function(){ var monthlyincome = $('#grossmonthlyincome').val().trim(); var cardid = $('#cardid').val().trim(); var sourceofincome =$("#form-stacked-select").val().trim(); console.log(sourceofincome+" g"+monthlyincome); var yearincome = $('#annualincome').val().trim(); if(monthlyincome!=""){ var finalincome =monthlyincome*12; finalincome = finalincome.toString(); // var len = $('#grossmonthlyincome').val().length; } if(yearincome!=""){ var finalincome =yearincome; finalincome = finalincome.toString(); } console.log("final"+finalincome+" L:"+finalincome.length); // if (monthlyincome === '' || yearincome] === '') { if (finalincome=="") { console.log("iff"); //$( ".cc_first_submit" ).prop('disabled', true); $('.mthlyErr').css('display', 'block').text('Enter your income'); return false; }else if(finalincome<2400000 && sourceofincome=="1" && cardid=="28229"){ alert('Thank you for your interest in a Standard Chartered Credit Card. We regret to inform you, that we are unable to proceed with your application as it doesn’t meet the prescribed policy requirements.'); return false; }else if(finalincome<1200000 && sourceofincome=="1" && cardid=="28237"){ alert('Thank you for your interest in a Standard Chartered Credit Card. We regret to inform you, that we are unable to proceed with your application as it doesn’t meet the prescribed policy requirements.'); return false; } else if(finalincome<300000 && sourceofincome=="1"){ alert('Thank you for your interest in a Standard Chartered Credit Card. We regret to inform you, that we are unable to proceed with your application as it doesn’t meet the prescribed policy requirements.'); return false; }else if(finalincome<3600000 && (sourceofincome=="3" || sourceofincome=="2")){ alert('Thank you for your interest in a Standard Chartered Credit Card. We regret to inform you, that we are unable to proceed with your application as it doesn’t meet the prescribed policy requirements.'); return false; } else { $('.mthlyErr').css('display', 'none') } // $(".cc_first_submit" ).prop( "disabled", false); }); $('.mobile2').on('change', function(){ var mobile = $('#mobile2').val().trim(); var phno = /^\d{10}$/ // $('.cc-btn-dsb').prop('disabled', true); if (mobile === '') { $('.mblErr').css('display', 'block').text('Enter your mobile number'); return false; }else if(!mobile.match(phno)) { $('.mblErr').css('display', 'block').text('Invalid mobile number'); return false; }else { $('.mblErr').css('display', 'none'); } //$('.cc-btn-dsb').prop('disabled', false); }); $('.nri_city').on('change', function(){ var nrcity = $('#city_select').val().trim(); if (nrcity === '') { $('.commonErr').css('display', 'block').text('Please select city'); $('#city_select_next').css('display', 'none'); var formfieldname=[{"formFieldValue":"", "formFieldName": "Preferred City"}]; var errorval =[{"errorCode":"400","errorField":"City","errorDescription":"select the city"}]; var errorData =[formfieldname,campaigndata,'Preferred City_Next','Middle',"button",errorval]; FormAdobeError("Preferred City","NRI_Accounts","personal","nr","NRI Banking",errorData); console.log("City Err"); return false; }else { $('.commonErr').css('display', 'none'); $(".next-btn").show(); } //$('.cc-btn-dsb').prop('disabled', false); }); $('.country_select_sel').on('change', function(){ var nrcity = $('#country_select').val().trim(); if (nrcity === '') { $('.commonErr').css('display', 'block').text('Please select Country'); $('#country_select_next').css('display', 'none'); var formfieldname=[{"formFieldValue":"", "formFieldName": "Country"}]; var errorval =[{"errorCode":"400","errorField":"Country","errorDescription":"Please select Country"}]; var errorData =[formfieldname,campaigndata, 'Country_Next','Middle',"button",errorval]; FormAdobeError("Country","NRI_Accounts","personal","nr","NRI Banking",errorData); return false; }else if (nrcity === 'Others') { $('.commonErr').css('display', 'block').text('Regret to inform, currently we are not facilitating NRI services for this particular country'); $('#country_select_next').css('display', 'none'); }else { // console.log("clicked cc"+$(this).find(':selected').attr('data-code')) $(".country_ext").val($(this).find(':selected').attr('data-code')); $('.commonErr').css('display', 'none'); $(".next-btn").show(); } //$('.cc-btn-dsb').prop('disabled', false); }); $('.product_interested_sel').on('change', function(){ var productin = $('#product_interested').val().trim(); if (productin === '') { $('.commonErr').css('display', 'block').text('Please select Product Interested'); $('#product_interested_next').css('display', 'none'); var formfieldname=[{"formFieldValue":"", "formFieldName": "Product"}]; var errorval =[{"errorCode":"400","errorField":"Product","errorDescription":"Please select Product"}]; var errorData =[formfieldname,campaigndata, 'Select_Product','Middle',"button",errorval]; FormAdobeError("Product","NRI_Accounts","personal","nr","NRI Banking",errorData); return false; }else { $('.commonErr').css('display', 'none'); $(".next-btn").show(); } }); // $('.pl-home-btn-dsb').on('change', function(){ // var pl_mob_number = $('#mobile1').val().trim(); // var phno = /^\d{10}$/ // $('.submit_pl_first').prop('disabled', true); // if (pl_mob_number === '') { // $('.mblErr').css('display', 'block').text('Enter your mobile number'); // return false; // }else if(!pl_mob_number.match(phno)) { // $('.mblErr').css('display', 'block').text('Invalid mobile number'); // return false; // }else { // $('.mblErr').css('display', 'none'); // } // $('.submit_pl_first').prop('disabled', false); // }); $(".tabs_head").click(function(){ $(".tabs_head").removeClass("tabs_head_active"); $(this).addClass("tabs_head_active"); var id = $(this).attr("id"); var id = "#para_"+((id.split("_"))[1]); $(".tabs_para").hide(); if(window.innerWidth >= 768){ $(id).show(); }else{ $(id).toggle(); } }); var current = []; var tags = []; var previous_from_element = []; $(".form-item select").change(delay(function (e) { var target = $(this).children("option:selected").data('target'); if(target != undefined){ current.push($(this).children("option:selected").data('current')); $(".form-item").removeClass("active"); $("."+target).addClass("active"); //console.log(current); $("#progressbar li").removeClass("active"); if(current.length <=2){ $("#progressbar li:nth-child(1)").addClass("active"); }else if(current.length >= 8){ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2),#progressbar li:nth-child(3)").addClass("active"); }else{ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2)").addClass("active"); } } }, 1250)); $(".form-item input[type=radio]").change(delay(function (e) { if(formValidation(e)){ return; } var target = $(this).data('target'); if(target != undefined){ current.push($(this).data('current')); $(".form-item").removeClass("active"); $("."+target).addClass("active"); //console.log(current); $("#progressbar li").removeClass("active"); if(current.length <=2){ $("#progressbar li:nth-child(1)").addClass("active"); }else if(current.length >= 8){ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2),#progressbar li:nth-child(3)").addClass("active"); }else{ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2)").addClass("active"); } } }, 1250)); $('.form-item input[type=text], input[type=email]').keyup(delay(function (e) { if(formValidation(e)){ return; } var target = $(this).data('target'); if(target != undefined){ /*if ($(this).hasClass('pl_employer_name')) { var thisVal = $(this).val(); var url = "http://imedia.iprospect.co/demo/lms/apis/masters/companies/?q="+thisVal; $("#companies_ajax ul").empty(); $.get(url, function( data ) { $.each( data.message, function( key, value ) { //console.log(value.code + ": " + value.title ); $("#companies_ajax ul").append("
  • "+value.title+"
  • "); }); //console.log(data); }); $("#companies_ajax a").on("click",function(){ alert('clicked'); $("#pl_employer_name").val($(this).data('title')); $("#emp_code").val($(this).data('code')); $("#companies_ajax ul").empty(); setTimeout(function() { current.push($(this).data('current')); $(".form-item").removeClass("active"); $("."+target).addClass("active"); console.log(current); }, 500); }); }else{ current.push($(this).data('current')); $(".form-item").removeClass("active"); $("."+target).addClass("active"); console.log(current); } */ /*Amit code start*/ if ($(this).hasClass('pl_employer_name')) { var root =""; var searchName = $('#pl_employer_name'); $( "#pl_employer_name" ).autocomplete({ minLength: 0, classes: { "ui-autocomplete": "dropdownList" }, search: function(){ searchName.addClass('loading'); }, source: function(request, response){ var searchKey = request["term"]; // $.get('http://imedia.iprospect.co/demo/lms/apis/masters/companies/?post_type=c&q="'+searchKey+'', function(data) { $.get('https://apply.standardchartered.co.in/apis/form-api-general/?post_type=c&q='+searchKey+'', function(data) { //console.log('Data->'+data.message); if(data == "" || typeof data == 'undefined') { alert('Record not found'); return; } if(data.message == "No company found") { alert("No company found"); return; } data = JSON.parse(data); var tagList = []; searchName.removeClass('loading'); $.each(data.message, function( key, value ) { // console.log(value.code + ": " + value.title); tagList.push({ label: value.title, value: value.title ,code: value.code }); }); response(tagList); }); }, open: function( event, ui ) { searchName.removeClass('loading'); }, response: function( event, ui ) { searchName.removeClass('loading'); }, select: function( event, ui ) { $('#emp_code').val(ui.item.code); $(".next-btn").show(); setTimeout(function(){ current.push(event.target.dataset.current); $(".form-item").removeClass("active"); $("."+target).addClass("active"); //console.log(current); $("#progressbar li").removeClass("active"); if(current.length <=2){ $("#progressbar li:nth-child(1)").addClass("active"); }else if(current.length >= 8){ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2),#progressbar li:nth-child(3)").addClass("active"); }else{ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2)").addClass("active"); } },1000 * 1.5); } }); } /*Amit code end*/ if(e.currentTarget.name == 'pl_home_emp_name') return; current.push($(this).data('current')); $(".form-item").removeClass("active"); $("."+target).addClass("active"); //console.log(current); $("#progressbar li").removeClass("active"); if(current.length <=2){ $("#progressbar li:nth-child(1)").addClass("active"); }else if(current.length >= 8){ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2),#progressbar li:nth-child(3)").addClass("active"); }else{ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2)").addClass("active"); } } }, 1250)); $(".back-btn").click(function(){ $(".form-item").removeClass("active"); $("."+current[current.length-1]).addClass("active"); current.pop(); //console.log(current); $("#progressbar li").removeClass("active"); if(current.length <=2){ $("#progressbar li:nth-child(1)").addClass("active"); }else if(current.length >= 8){ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2),#progressbar li:nth-child(3)").addClass("active"); }else{ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2)").addClass("active"); } }); $(".next-btn").click(function(){ $(".form-item").removeClass("active"); var target = $(this).data('target'); current.push($(this).data('current')); $("."+target).addClass("active"); //console.log(current); $("#progressbar li").removeClass("active"); if(current.length <=2){ $("#progressbar li:nth-child(1)").addClass("active"); }else if(current.length >= 8){ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2),#progressbar li:nth-child(3)").addClass("active"); }else{ $("#progressbar li:nth-child(1),#progressbar li:nth-child(2)").addClass("active"); } }); // $(".cc_rs").change(function(){ // if($(this).val() == "Super Value Titanium"){ // alert("You cannot apply for the card variant you already hold."); // $(this).val("Select Card"); // } // }); $(".form_slider").submit(function(e){ e.stopPropagation(); e.preventDefault(); }); $(".faqs li .uk-accordion-title").click(function(){ var ic = $(this).find("span").attr("uk-icon"); if(ic == "icon:plus"){ $(this).find("span").attr("uk-icon","icon:minus"); }else{ $(this).find("span").attr("uk-icon","icon:plus"); } }); $(".compare_cards").click(function(){ var len = $('.uk-checkbox:checked').length; if(len>=2){ $(".card_slider_wrapper > ul > li").each(function () { var a = $(this).find("input[type='checkbox']"); //console.log(a); if(! a[0].checked){ $(this).remove(); $(".view_all").show(); $(".compare_cards_wrapper").hide(); } }); }else{ alert("Please select more than 1 card"); } }); $(".verification_text2").val(makeid(4)); $(".refresh_id").click(function(){ $(".verification_text2").val(makeid(4)); }); $(".country_select").change(function(){ $(".country_ext").val($(this).find(':selected').attr('data-code')); }); $( function() { $( "#datepicker" ).datepicker({ onSelect: function(value, ui) { var current = new Date().getTime(), dateSelect = new Date(value).getTime(); age = current - dateSelect; ageGet = Math.floor(age / 1000 / 60 / 60 / 24 / 365.25); // age / ms / sec / min / hour / days in a year console.log("selected dt"+ageGet+'g '+value) if(ageGet < 18){ less_than_18(ageGet); }else if(ageGet > 67){ greater_than_18(ageGet);//defaultDate: '-18yr', } }, changeMonth: true, changeYear: true, yearRange: '-99:-18', dateFormat: 'dd/mm/yy', defaultDate: '-18yr', }); $( ".datepicker" ).datepicker({ changeMonth: true, changeYear: true, //yearRange: '-99:-18', minDate: new Date(), dateFormat: 'dd/mm/yy' }); $( "#datepicker_dob" ).datepicker({ onSelect: function(value, ui) { var current = new Date().getTime(), dateSelect = new Date(value).getTime(); age = current - dateSelect; ageGet = Math.floor(age / 1000 / 60 / 60 / 24 / 365.25); // age / ms / sec / min / hour / days in a year //console.log("selected dt"+ageGet+'g '+value) if(ageGet < 18){ less_than_18(ageGet); }else if(ageGet > 67){ greater_than_18(ageGet);//defaultDate: '-18yr', } }, changeMonth: true, changeYear: true, yearRange: '-80:-18', dateFormat: 'yy/mm/dd', defaultDate: '-18yr', }); }); // range input js $( "#slider").slider({ range: "min", max: 1000000, value: 500000, min:300000 }); $( "#slider2").slider({ range: "min", max: 5, value: 3, min:1, step:1 }); var handle = $( "#custom-handle" ); $( "#slider" ).slider({ create: function() { handle.val( $( this ).slider( "value" ) ); }, slide: function( event, ui ) { handle.val( numberWithCommas(ui.value) ); } }); var handle2 = $( "#custom-handle2" ); $( "#slider2" ).slider({ create: function() { handle2.val( $( this ).slider( "value" ) ); }, slide: function( event, ui ) { handle2.val( ui.value ); } }); $("#custom-handle").on("change keyup paste click", function(){ $("#slider").slider("value", $(this).val()); }); $("#custom-handle2").on("change keyup paste click", function(){ $("#slider2").slider("value", $(this).val()); }); $('.update_form').click(function(e){ var title = $('#title').val(); var firstname = $('#fname').val(); var lastname = $('#lname').val(); var gender = $('#gender').val(); var email = $('#email').val(); var education = $('#education').val(); var dob = $('#datepi').val(); var mobile = $('#mobile').val(); var pincode = $('#pincode').val(); var address = $('#address').val(); var landmark = $('#landmark').val(); var purpose = $('#purpose').val(); var pl_company = $('#pl_company').val(); var emp_type = $('#emp_type').val(); var work_type = $('#work_type').val(); var net_monthly_income = $('#net_monthly_income').val(); var off_add1 = $('#off_add1').val(); var totexp = $('#totexp').val(); var off_landmark = $('#off_landmark').val(); var off_phone = $('#off_phone').val(); var off_state = $('#off_state').val(); var office_pincode = $('#office_pincode').val(); var employer_industry = $('#employer_industry').val(); var off_lma = $('#off_lma').val(); var pl_app_gincome = $('#pl_app_gincome').val(); var off_income_total = $('#off_income_total').val(); var ploff_income_other = $('#ploff_income_other').val(); var start_date = $('#start_date').val(); var curr_yr_tax = $('#curr_yr_tax').val(); var cygt = $('#cygt').val(); var pyti = $('#pyti').val(); var dsc_applicant = $('#dsc_applicant').val(); var mod_salary = $('#mod_salary').val(); var pan = $('#pan').val(); var tenure = $('#tenure').val(); var passport_no = $('#passport_no').val(); var passport_val = $('#passport_validity').val(); var lic_no = $('#lic_no').val(); var lic_val = $('#lic_validity').val(); var voter_id = $('#voter_id').val(); var doc_type = $('#doc_type').val(); var pattern = /^\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/i; var panregex = /[A-Z]{5}[0-9]{4}[A-Z]{1}$/; if(firstname == ''){ alert('First Name cannot be blank!!'); $('#fname').focus(); return false; } if(lastname == ''){ alert('Last Name cannot be blank!!'); $('#lname').focus(); return false; } if(title == '' || title =='Select Title'){ alert('Title cannot be blank!!'); $('#title').focus(); return false; } if(gender == '' || gender == 'Select Gender'){ alert('Gender cannot be blank!!'); $('#gender').focus(); return false; } if(email == ''){ alert('Email cannot be blank!!'); $('#email').focus(); return false; }else if(!pattern.test(email)) { alert('Not a valid e-mail address'); $('#email').focus(); return false; } if(education == '' || education == 'Select'){ alert('Education cannot be blank!!'); $('#education').focus(); return false; } if(dob == ''){ alert('DOB cannot be blank!!'); $('#datepicker').focus(); return false; } if(mobile == ''){ alert('Mobile cannot be blank!!'); $('#mobile').focus(); return false; } if(pincode === '') { alert('Zip must not be blank'); $('#pincode').focus(); return false; } if(address === '') { alert('Address must not be blank'); $('#address').focus(); return false; } if(landmark === '') { alert('Landmark must not be blank'); $('#landmark').focus(); return false; } if(purpose == '' || purpose == 'Select'){ alert('Purpose of loan cannot be blank!!'); $('#purpose').focus(); return false; } if(pl_company == '' || pl_company == ' -'){ alert('Company/Employer cannot be blank!!'); $('#pl_company').focus(); return false; } if(emp_type == '' || emp_type == 'Select Occupation'){ alert('Occupation cannot be blank!!'); $('#emp_type').focus(); return false; } if(work_type == '' || work_type == 'Select Work Type'){ alert('WorkType cannot be blank!!'); $('#work_type').focus(); return false; } if(emp_type == '4' || emp_type == '5' || emp_type == '6' || emp_type == '1'){ if(net_monthly_income == ''){ alert('Monthly Income cannot be blank!!'); $('#net_monthly_income').focus(); return false; } } if(off_add1 == ''){ alert('Office Address cannot be blank!!'); $('#off_add1').focus(); return false; } if(totexp == '' ) { alert('Total Work Experience must not be blank'); $('#totexp').focus(); return false; } if(off_landmark == '' ){ alert('Office Landmark cannot be blank!!'); $('#off_landmark').focus(); return false; } if(off_phone == '' ){ alert('Office Phone cannot be blank!!'); $('#off_phone').focus(); return false; } if(off_state == '' || off_state =='Office State'){ alert('Office State cannot be blank!!'); $('#off_state').focus(); return false; } if(off_pincode == '' ){ alert('Office Phone cannot be blank!!'); $('#off_phone').focus(); return false; } if(tenure == '' ){ alert('Tenure cannot be blank!!'); $('#tenure').focus(); return false; } if(employer_industry == '' || employer_industry =='Select Industry'){ alert('Employer Industry cannot be blank!!'); $('#employer_industry').focus(); return false; } if(off_lma == '' || off_lma == 'Select Loan Mailing Address') { alert('Loan mailing address must not be blank'); $('#off_lma').focus(); return false; } if(document_type == '' || document_type == 'Select' || document_type == 'Income Proof Document'){ alert('Income Proof Document cannot be blank!!'); $('#document_type').focus(); return false; } if(pl_app_gincome == '' ) { alert('Annual gross income must not be blank'); $('#pl_app_gincome').focus(); return false; } if(off_income_total == '' ) { alert('Total income must not be blank'); $('#off_income_total').focus(); return false; } if(ploff_income_other == '' ) { alert('Other income must not be blank'); $('#ploff_income_other').focus(); return false; } if(emp_type == '2' || emp_type == '3'){ if(start_date == '' ) { alert('Start date for current Business/Profession must not be blank'); $('#start_date').focus(); return false; } } if(emp_type == '2' || emp_type == '3'){ if(curr_yr_tax == '') { alert('Current year taxable income must not be blank'); $('#curr_yr_tax').focus(); return false; } } if(emp_type == '2'){ if(cygt == '') { alert('Current year gross turnover must not be blank'); $('#cygt').focus(); return false; } } if(emp_type == '2' || emp_type == '3'){ if(pyti == '') { alert('Previous year taxable income must not be blank'); $('#pyti').focus(); return false; } } if(emp_type == '2'){ if(dsc_applicant == '' || dsc_applicant == 'Select best describes applicant ') { alert('Choose option that best describes applicant must not be blank'); $('#dsc_applicant').focus(); return false; } } if(emp_type == '2' || emp_type == '3'){ if(mod_salary == '' || mod_salary =='Select') { alert('Mode of salary must not be blank'); $('#mod_salary').focus(); return false; } } if(!panregex.test(pan)){ alert("invalid PAN no"); $('#pan').focus(); return panregex.test(pan); } if(doc_type == 'none'){ alert('Document Type cannot be blank!!'); $('#doc_type').focus(); return false; } else if(doc_type == 'passport') { if(passport_no == '' || passport_val == ''){ alert('Passport Number Or Passport Validity cannot be blank!!'); $('#doc_type').focus(); return false; } }else if(doc_type == 'driving') { if(lic_no == '' || lic_val == ''){ alert('Driving License Or Driving License Validity cannot be blank!!'); $('#doc_type').focus(); return false; } }else if(doc_type == 'voter') { if(voter_id == ''){ alert('Voter ID cannot be blank!!!'); $('#doc_type').focus(); return false; } } return flag = true; }); }); function hideDom(className,id) { $('.'+className).hide(); $('#'+id).val(""); } function less_than_18(theAge){ alert("Your age should be between 18 to 67 years range"); $("#datepicker").val();return false; } function greater_than_18(theAge){ //salaried 62 alert("Your age should be between 18 to 67 years range! "); $("#datepicker").val();return false; } function onDocumentChange(){ var type = $('#doc_type').val(); if(type == 'passport') { $('.passport').show(); $('.passport_val').show(); hideDom('driving','lic_no'); hideDom('driving_val','lic_validity'); hideDom('voter','voter_id'); } if(type == 'driving') { $('.driving').show(); $('.driving_val').show(); hideDom('passport','passport_no'); hideDom('passport_val','passport_validity'); hideDom('voter','voter_id'); } if(type == 'voter') { $('.voter').show(); hideDom('passport','passport_no'); hideDom('passport_val','passport_validity'); hideDom('driving','lic_no'); hideDom('driving_val','lic_validity'); } if(type == 'none') { hideDom('passport','passport_no'); hideDom('passport_val','passport_validity'); hideDom('driving','lic_no'); hideDom('driving_val','lic_validity'); hideDom('voter','voter_id'); } } function isNumber(obj,evt) { var iKeyCode = (evt.which) ? evt.which : evt.keyCode if (iKeyCode != 46 && iKeyCode > 31 && (iKeyCode < 48 || iKeyCode > 57)) { return false; } if ($(obj).length <= 10) { if (iKeyCode == 46) { return false; } else { return true; } } return false; } function showOccupationFields(val) { var optionSelected = $("#emp_type").val(); if(optionSelected=="4" || optionSelected=="5" || optionSelected=="6"){ $("#salaried_scb").show(); $("#se-business").hide(); }else if(optionSelected=="2"){ $("#salaried_scb").hide(); $("#se-business").show(); $("#self_emp_prof_income_other").hide(); $("#self_emp_prof_txtinc").hide(); $("#self_emp_prof_occ").hide(); $("#self_emp_business_gt").show(); $("#self_emp_business_dsc_app").show(); }else if(optionSelected=="3"){ $("#salaried_scb").hide(); $(".dsc_applicant").hide(); $("#se-business").show(); $("#self_emp_prof_income_other").show(); $("#self_emp_prof_txtinc").show(); $("#self_emp_prof_occ").show(); $("#self_emp_business_gt").hide(); $("#self_emp_business_dsc_app").hide(); } } function ValidateCCform(){ var errorfield ="Title"; var errorfieldmsg ="Data Validation Error"; var title = $('#title').val(); var fname = $('#fname').val(); var lname = $('#lname').val(); var datepicker = $('#datepicker').val(); var gender = $('#gender').val(); //var email = $('#email').val(); var occupation = $('#off_occ').val(); var dependents = $('#dependents').val(); var education = $('#education').val(); var work_type = $('#work_type').val(); var add1 = $('#add1').val(); var landmark = $('#landmark').val(); var city = $('#city').val(); var pincode = $('#cc_homepin').val(); var re_type = $('#re-type').val(); var cd_m_address = $('#off_lma').val(); var pa1 = $('#pa1').val(); var pal1 = $('#pal1').val(); var pstate = $('#pstate').val(); var pcity = $('#pcity').val(); var ppincode = $('#ppincode').val(); //var cc_company = $('#cc_company').val(); var designation = $('#designation').val(); var off_industry = $('#off_industry').val(); var tt_work = $('#tt_work').val(); var bank_branch = $('#bank_branch').val(); var ofc_email = $('#ofc_email').val(); var off_add1 = $('#off_add1').val(); var off_landmark = $('#off_landmark').val(); var ofc_city = $('#ofc_city').val(); var off_pincode = $('#off_pincode').val(); var document_type = $('#document_type').val(); var anl_income = $('#anl_income').val(); var mthly_income = $('#mthly_income').val(); var monthly_bonus = $('#monthly_bonus').val(); var pan = $('#pan').val(); //var chkPan = $('#pan_later').is(':checked'); var chkaddress = $('#chkaddress').is(':checked'); var checkterm = $('#check1').is(':checked'); var ex_scb_cust_yes = $("#ex_scb_cust_ys").is(":checked"); var ex_scb_cust_no = $("#ex_scb_cust_no").is(":checked"); var sales_cc = $("#sales_cc").val(); var passport_no = $('#passport_no').val(); var passport_val = $('#passport_validity').val(); var lic_no = $('#lic_no').val(); var lic_val = $('#lic_validity').val(); var voter_id = $('#voter_id').val(); var doc_type = $('#other_id').val(); var emp_type = $('#emp_type').val(); var zipregex = /^\d{6}$/; var panregex = /[A-Z]{5}[0-9]{4}[A-Z]{1}$/; //var pattern = /^\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/i; var id = $(this).attr('id') console.log('ID-->'+ id); var flag = true; if(title == '' || title == 'Select'){ alert('Please select Title!!'); $('#title').focus(); flag = false; errorfieldmsg ="Title cannot be blank!!"; errorfield="Title"; return [flag,errorfield,errorfieldmsg]; //return false; } if(fname == ''){ alert('First Name cannot be blank!!'); $('#fname').focus(); flag = false; errorfieldmsg ="FirstName cannot be blank!!"; errorfield="FirstName"; return [flag,errorfield,errorfieldmsg]; // return false; } if(lname == ''){ alert('Last Name cannot be blank!!'); $('#lname').focus(); flag = false; errorfieldmsg ="Last Name cannot be blank!!"; errorfield="Last Name"; return [flag,errorfield,errorfieldmsg]; //return false; } if(datepicker == ''){ alert('DOB cannot be blank!!'); $('#datepicker').focus(); flag = false; errorfieldmsg ="DOB cannot be blank!!"; errorfield="DOB"; return [flag,errorfield,errorfieldmsg]; // return false; } if(gender == ''){ alert('Gender cannot be blank!!'); $('#gender').focus(); flag = false; errorfieldmsg ="Gender cannot be blank!!"; errorfield="Gender"; return [flag,errorfield,errorfieldmsg]; //return false; } // if(email === '') { // alert('Provide Email Address'); // $("#email").focus(); // return false; // }else if (!pattern.test(email)) { // alert('Please enter Valid email-address'); // $("#email").focus(); // return false; // } if(occupation == ''){ alert('Occupation cannot be blank!!'); $('#off_occ').focus(); flag = false; errorfieldmsg ="Occupation cannot be blank!!"; errorfield="Occupation"; return [flag,errorfield,errorfieldmsg]; // return false; } if(dependents == ''){ alert('Dependents cannot be blank!!'); $('#dependents').focus(); flag = false; errorfieldmsg ="Dependents cannot be blank!!"; errorfield="Dependents"; return [flag,errorfield,errorfieldmsg]; // return false; } if(education == '' || education == 'Select' || education == 'Select Educational qualification'){ alert('Education cannot be blank!!'); $('#education').focus(); flag = false; errorfieldmsg ="Education cannot be blank!!"; errorfield="Education"; return [flag,errorfield,errorfieldmsg]; //return false; } if(work_type == '' || work_type == 'Select'){ alert('WorkType cannot be blank!!'); $('#work_type').focus(); flag = false; errorfieldmsg ="WorkType cannot be blank!!"; errorfield="WorkType"; return [flag,errorfield,errorfieldmsg]; //return false; } if(add1 == ''){ alert('Address1 cannot be blank!!'); $('#add1').focus(); flag = false; errorfieldmsg ="Address1 cannot be blank!!"; errorfield="Address1"; return [flag,errorfield,errorfieldmsg]; //return false; } if(landmark == ''){ alert('Landmark cannot be blank!!'); $('#landmark').focus(); flag = false; errorfieldmsg ="Landmark cannot be blank!!"; errorfield="Landmark"; return [flag,errorfield,errorfieldmsg]; //return false; } if(city == '' || city =='Select'){ alert('City cannot be blank!!'); $('#city').focus(); flag = false; errorfieldmsg ="City cannot be blank!!"; errorfield="City"; return [flag,errorfield,errorfieldmsg]; //return false; } if(pincode === '') { alert('Pincode must not be blank'); $("#cc_homepin").focus(); flag = false; errorfieldmsg ="Pincode cannot be blank!!"; errorfield="Pincode"; return [flag,errorfield,errorfieldmsg]; //return false; }else if(!pincode.match(zipregex)) { alert('Pincode must have six digits'); $("#cc_homepin").focus(); flag = false; errorfieldmsg ="Pincode must be six digits"; errorfield="Pincode"; return [flag,errorfield,errorfieldmsg]; //return false; } if(re_type == '' || re_type =='Select'){ alert('Residence Type cannot be blank!!'); $('#re_type').focus(); flag = false; errorfieldmsg ="Residence Type cannot be blank!!"; errorfield="Residence Type"; return [flag,errorfield,errorfieldmsg]; //return false; } if(cd_m_address == '' || cd_m_address =='Select'){ alert('Card mailing address cannot be blank!!'); $('#cd-m-address').focus(); flag = false; errorfieldmsg ="Card Mailing address cannot be blank!!"; errorfield="Card mailing address"; return [flag,errorfield,errorfieldmsg]; //return false; } if(!chkaddress) { if(pa1 == '' ){ alert('Permanent Address line 1 cannot be blank!!'); $('#pa1').focus(); flag = false; errorfieldmsg ="Address1 cannot be blank!!"; errorfield="Address1"; return [flag,errorfield,errorfieldmsg]; // return false; } if(pal1 == '' ){ alert('Permanent Address Landmark cannot be blank!!'); $('#pal1').focus(); flag = false; errorfieldmsg ="Permanent Address cannot be blank!!"; errorfield="Permanent Address"; return [flag,errorfield,errorfieldmsg]; //return false; } if(pstate == '' || pstate == 'Select'){ alert('Permanent State cannot be blank!!'); $('#pstate').focus(); flag = false; errorfieldmsg ="Permanent state cannot be blank!!"; errorfield="Permanent state"; return [flag,errorfield,errorfieldmsg]; // return false; } if(pcity == '' || pcity == 'Select'){ alert('Permanent City cannot be blank!!'); $('#pcity').focus(); flag = false; errorfieldmsg ="Permanent city cannot be blank!!"; errorfield="Permanent city"; return [flag,errorfield,errorfieldmsg]; // return false; } if(ppincode === '') { alert('Permanent Pincode must not be blank'); $("#ppincode").focus(); flag = false; errorfieldmsg ="Permanent Pincode cannot be blank!!"; errorfield="Permanent pincode"; return [flag,errorfield,errorfieldmsg]; // return false; } } // if(cc_company == ''){ // alert('Company cannot be blank!!'); // $('#cc_company').focus(); // flag = false; // errorfieldmsg ="Company cannot be blank!!"; // errorfield="Company"; // return [flag,errorfield,errorfieldmsg]; // //return false; // } if(designation == '' || designation == 'Select' || designation=='Select Designation'){ alert('Designation cannot be blank!!'); $('#designation').focus(); flag = false; errorfieldmsg ="Designation cannot be blank!!"; errorfield="Designation"; return [flag,errorfield,errorfieldmsg]; // return false; } if(off_industry == '' || off_industry == 'Select' || off_industry == 'Select Industry(ISIC)'){ alert('Industry cannot be blank!!'); $('#off_industry').focus(); flag = false; errorfieldmsg ="Industry ISIC cannot be blank!!"; errorfield="Industry"; return [flag,errorfield,errorfieldmsg]; // return false; } if(tt_work == '' || tt_work == 'Select' || tt_work == 'Select work experience'){ alert('Total work experience cannot be blank!!'); $('#tt_work').focus(); flag = false; errorfieldmsg ="Work Experience cannot be blank!!"; errorfield="Work Experience"; return [flag,errorfield,errorfieldmsg]; // return false; } if(bank_branch == '' || bank_branch == 'Select' || bank_branch =='Select Salaried bank account with'){ alert('Salaried bank account with cannot be blank!!'); $('#bank_branch').focus(); flag = false; errorfieldmsg ="Salaried bank account cannot be blank!!"; errorfield="Salaried bank account"; return [flag,errorfield,errorfieldmsg]; //return false; } // if(ofc_email === '') { // alert('Email address must not be blank'); // $("#ofc_email").focus(); // return false; // }else if(emailValidation(ofc_email) === false) { // alert('Invalid email address'); // $("ofc_email").focus(); // return false; // } if(off_add1 == '' ){ alert('Office address cannot be blank!!'); $('#off_add1').focus(); flag = false; errorfieldmsg ="Office address cannot be blank!!"; errorfield="office address"; return [flag,errorfield,errorfieldmsg]; //return false; } if(off_landmark == '' ){ alert('Office Landmark cannot be blank!!'); $('#off_landmark').focus(); flag = false; errorfieldmsg ="Office Landmark cannot be blank!!"; errorfield="Office Landmark"; return [flag,errorfield,errorfieldmsg]; // return false; } if(ofc_city == '' || ofc_city == 'Select' || ofc_city == 'Select City'){ alert('Office City cannot be blank!!'); $('#ofc_city').focus(); flag = false; errorfieldmsg ="Office city cannot be blank!!"; errorfield="City"; return [flag,errorfield,errorfieldmsg]; // return false; } if(off_pincode === '') { alert('Office Pincode must not be blank'); $("#off_pincode").focus(); flag = false; errorfieldmsg ="Office Pincode cannot be blank!!"; errorfield="Office Pincode"; return [flag,errorfield,errorfieldmsg]; }else if(!off_pincode.match(zipregex)) { alert('Office Pincode must have six digits'); $("#off_pincode").focus(); flag = false; return [flag,errorfield,errorfieldmsg]; } if(document_type == '' || document_type == 'Select' || document_type == 'Income Proof Document'){ alert('Income Proof Document cannot be blank!!'); $('#document_type').focus(); flag = false; errorfieldmsg ="Income Proof document cannot be blank!!"; errorfield="Income Proof Document"; return [flag,errorfield,errorfieldmsg]; } if(anl_income == ''){ alert('Annual declared income cannot be blank!!'); $('#anl_income').focus(); //return false; flag = false; errorfieldmsg ="Annual Declared Income cannot be blank!!"; errorfield="Annual Declared Income"; return [flag,errorfield,errorfieldmsg]; } if(mthly_income == ''){ alert('Basic Monthly Salary cannot be blank!!'); $('#mthly_income').focus(); // return false; flag = false; errorfieldmsg ="Basic Monthly Salary cannot be blank!!"; errorfield="Basic Monthly Salary"; return [flag,errorfield,errorfieldmsg]; } /* // Monthly bonus not to be mandatory if(monthly_bonus == ''){ alert('Basic Monthly Salary cannot be blank!!'); $('#monthly_bonus').focus(); return false; }*/ //if (!chkPan) { if(!panregex.test(pan)){ alert("invalid PAN no"); $('#pan').focus(); flag = false; errorfieldmsg ="Invalid Pan No!!"; errorfield="PAN NO"; return [flag,errorfield,errorfieldmsg]; //return panregex.test(pan); } //} if(!checkterm){ alert('Check Terms & condition!!'); $('#checkterm').focus(); // return false; flag = false; errorfieldmsg ="Check Terms & condition!!"; errorfield="T&C"; return [flag,errorfield,errorfieldmsg]; } if(!ex_scb_cust_yes && !ex_scb_cust_no && sales_cc != 'Yes'){ alert('Please check radio button for Existing SCB Customer or not!!'); $('#ex_scb_cust_ys').focus(); flag = false; errorfieldmsg ="Please check radio button for Existing SCB Customer or not"; errorfield="Existing SCB Customer"; return [flag,errorfield,errorfieldmsg]; //return false; } if(doc_type == 'none'){ alert('Document Type cannot be blank!!'); $('#doc_type').focus(); flag = false; errorfieldmsg ="Document Type cannot be blank!!"; errorfield="Document Type"; return [flag,errorfield,errorfieldmsg]; //return false; } else if(doc_type == 'passport' || doc_type == '231') { if(passport_no == '' || passport_val == ''){ alert('Passport Number Or Passport Validity cannot be blank!!'); $('#doc_type').focus(); flag = false; errorfieldmsg ="Passport Validity cannot be blank!!"; errorfield="Passport Validity"; return [flag,errorfield,errorfieldmsg]; //return false; } }else if(doc_type == 'driving' || doc_type=="98") { if(lic_no == '' || lic_val == ''){ alert('Driving License Or Driving License Validity cannot be blank!!'); $('#doc_type').focus(); flag = false; errorfieldmsg ="Driving License Validity cannot be blank!!"; errorfield="Driving License Validity"; return [flag,errorfield,errorfieldmsg]; // return false; } }else if(doc_type == 'voter' || doc_type=="346") { if(voter_id == ''){ alert('Voter ID cannot be blank!!!'); $('#doc_type').focus(); flag = false; errorfieldmsg ="Voter ID cannot be blank!!"; errorfield="Voter ID"; return [flag,errorfield,errorfieldmsg]; // return false; } } if(emp_type == '' || emp_type == 'Select Employment Type'){ alert('Employment Type cannot be blank!!'); $('#emp_type').focus(); flag = false; errorfieldmsg ="Employment Type cannot be blank!!"; errorfield="Employment Type"; return [flag,errorfield,errorfieldmsg]; // return false; } return [flag,errorfield,errorfieldmsg]; } function setUTMparameters(){ var strHref = window.location.href; var strQueryString = ""; if (strHref.indexOf("?") > -1) { strQueryString = strHref.substr(strHref.indexOf("?") + 1); } if (strQueryString!="") { $('#utm_param').val(strQueryString); } var qs = strQueryString; var utm_campaign = ""; var id = ""; console.log('here im'+qs); if (qs.indexOf("&") > -1) { for (var i = 0; i < qs.split('&').length; i++) { var param_val = qs.split('&')[i].split('=')[0].toLowerCase(); // console.log(qs.split('&')[i].split('=')[0]+' :: here param_val'+param_val); if (param_val == "utm_campaign") { //|| param_val == "cp" utm_campaign = (qs.split('&')[i].split('=')[1]); $('#utm_campaign').val(utm_campaign); console.log('here utm_campaign Val:: '+utm_campaign); } if (param_val == "utm_source") { //|| param_val == "se" utm_source = (qs.split('&')[i].split('=')[1]); $('#utm_source').val(utm_source); console.log(' utm_source Val:: '+utm_source); } if (param_val == "utm_medium") { // || param_val == "pid" utm_medium = (qs.split('&')[i].split('=')[1]); $('#utm_medium').val(utm_medium); console.log(' utm_medium Val:: '+utm_medium); } if (param_val == "utm_adgroup" || param_val == "ag") { utm_adgroup = (qs.split('&')[i].split('=')[1]); $('#utm_adgroup').val(utm_adgroup); console.log(' utm_adgroup Val:: '+utm_adgroup); } if (param_val == "utm_channel") { utm_channel = (qs.split('&')[i].split('=')[1]); $('#utm_channel').val(utm_channel); console.log(' utm_channel Val:: '+utm_channel); } } } } //new validation cc next button $('#zipcode_next').click(function(){ var pincode =$('#zipcode').val(); var zipregex = /^\d{6}$/; var mobile =$('#mobile1').val(); var name =$('#full_name1').val(); var cardtitle =$("#card_name").val(); var cardid =$("#cc_product").val(); var flag=true; var targetid =$(this).attr("data-id"); $(this).attr('data-target',"form-item-7"); $(this).fadeIn(); if(pincode === '') { $('.pinErr').css('display', 'block').text('Enter the Pincode'); // $(this).attr('data-target',"form-item-7"); $('#pincode').focus(); flag = false; }else if(!pincode.match(zipregex)) { $('.pinErr').css('display', 'block').text('Pincode must have six digits'); // $(this).attr('data-target',"form-item-7"); $('#pincode').focus(); flag = false; }else { if(pincode.length==6){ console.log("pin"+pincode.length); var dataid =$("#zipcode").attr("data-id"); var validpin = validatePincode(pincode,dataid,root); console.log("pin "+validpin); flag = validpin; if(validpin==false){ $(this).data('target', "form-item-7"); $(this).fadeIn(); }else{ $(this).data('target', "form-item-8"); var zipnext =['na','na','Pincode_next','Middle',"button",campaigndata]; ProductCC_CTAclickAdobe("Pin Code","CC_NTB",cardtitle,cardid,zipnext); //Existing $(this).fadeIn(); } } $('.pinErr').css('display', 'none'); //$(".next-btn").show(); } }); $('#pl_pincode_pi_next').click(function(){ var pincode =$('#pl_pincode_pi').val(); var income =$("#pl_gross_income").val(); var zipregex = /^\d{6}$/; var flag=true; var targetid =$(this).attr("data-id"); $(this).attr('data-target',"form-item-5"); $(this).fadeIn(); if(pincode === '') { $('.pinErr').css('display', 'block').text('Enter the Pincode'); // $(this).attr('data-target',"form-item-7"); $('#pincode').focus(); flag = false; }else if(!pincode.match(zipregex)) { $('.pinErr').css('display', 'block').text('Pincode must have six digits'); // $(this).attr('data-target',"form-item-7"); $('#pincode').focus(); flag = false; }else { if(pincode.length==6){ console.log("pin"+pincode.length); var dataid =$("#pl_pincode_pi").attr("data-id"); var validpin = validatePincode(pincode,dataid,root); console.log("pin "+validpin); flag = validpin; if (validpin == true) { $(this).data('target', "form-item-6"); $(".form-item").removeClass("active"); $(".form-item-6").addClass("active"); }else{ console.log("flse"); $(this).data('target', "form-item-5"); $(".form-item").removeClass("active"); $(".form-item-5").addClass("active"); } } $('.pinErr').css('display', 'none'); //$(".next-btn").show(); console.log("flag PinNext"+flag); } }); $('#pl_gross_income_next').click(function(){ var targetid =$(this).attr("data-id"); var grossincome =$('#pl_gross_income').val(); grossincome = grossincome.toString(); var flag=true; if (grossincome === '') { $('.commonErr').css('display', 'block').text('Please Enter Gross Income'); $(this).attr('data-target',"form-item-10"); $('#pl_gross_income').focus(); flag = false; // return false; }else if(grossincome <=25000){ alert("Thank you for your interest in a Standard Chartered Personal Loan. We regret to inform you, that we are unable to proceed with your application as it doesn’t meet the prescribed policy requirements."); $('.commonErr').css('display', 'none').text(''); $(this).attr('data-target',"form-item-10"); $('#pl_gross_income').focus(); flag = false; }else if(grossincome >10000000){ alert("Thank you for your interest in a Standard Chartered Personal Loan. We regret to inform you, that we are unable to proceed with your application as it doesn’t meet the prescribed policy requirements."); $('.commonErr').css('display', 'none').text(''); $(this).attr('data-target',"form-item-10"); $('#pl_gross_income').focus(); flag = false; }else { $('.commonErr').css('display', 'none'); } if (flag == true) { $(this).data('target', "form-item-5"); $(".form-item").removeClass("active"); $(".form-item-5").addClass("active"); }else{ $(this).data('target', "form-item-10"); $(".form-item").removeClass("active"); $(".form-item-10").addClass("active"); } }); $('#email_mobile_next').click(function(){ var targetid =$(this).attr("data-id"); var email =$('#email1').val(); var mobile =$('#mobile1').val(); var name =$('#full_name1').val(); var pattern = /^\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/i; var phno = /^\d{10}$/; var regName = /^[a-zA-Z]+ [a-zA-Z]+$/; ///^[a-z][a-z\s]*$/ var flag=true; var cardtitle =$("#card_name").val(); var cardid =$("#cc_product").val(); if (name === '') { $('.fullnameErr').css('display', 'block').text('Enter FirstName and Last Name'); $(this).attr('data-target',"form-item-4"); $('#full_name1').focus(); flag = false; // return false; }else { $('.fullnameErr').css('display', 'none'); $('#emailid').focus(); } // else if(!regName.test(name)){ // $('.fullnameErr').css('display', 'block').text('Please enter your full name (first & last name)'); // $(this).attr('data-target',"form-item-4"); // $('#full_name1').focus(); // flag = false; // } // Email validation if (email === '') { $('.emailErr').css('display', 'block').text('Email cannot be blank!!'); $(this).attr('data-target',"form-item-4"); $('#email1').focus(); flag = false; // return false; } else if (!pattern.test(email)) { $('.emailErr').css('display', 'block').text('Please enter valid e-mail address'); $(this).attr('data-target',"form-item-4"); $('#email1').focus(); flag = false; //return false; } else { $('.emailErr').css('display', 'none'); $('#mobile1').focus(); } console.log("flag"+flag); if (flag == true) { // alert("valid here"); // console.log("valid"+targetid); var arradobepersonal =['na','na','personal details_proceed','Middle',"button",campaigndata]; ProductCC_CTAclickAdobe("Personal Details","CC_NTB",cardtitle,cardid,arradobepersonal); $(this).data('target', "form-item-7"); $(this).fadeIn(); }else{ console.log("err"); $(this).data('target', "form-item-4"); $(this).fadeIn(); //alert("please provide all information"); return false; } }); $("#mobile_input_next").click(function(){ var val =$("#mobile_input").val(); var val2 =$("input[name=code]").val(); var val3 =$("input[name=mobile_number_alt]").val(); var phno = /^\d{10}$/; var formfieldname=[{"formFieldValue":"na", "formFieldName": "Mobile Number"}]; if(val==""){ $('.mblErr').css('display', 'block').text('Please enter Mobile Number'); console.log("err mob"); $(this).attr('data-target',"form-item-6"); $(this).fadeIn(); var errorval =[{"errorCode":"400","errorField":"Contact Number","errorDescription":"Please enter Mobile Number"}]; var errorData =[formfieldname,campaigndata,'Contact Details_Next','Middle',"button",errorval]; FormAdobeError("Contact Details","NRI_Accounts","personal","nr","NRI Banking",errorData); return false; }else{ console.log("no error valid"); $('.mblErr').css('display', 'none').text(''); //$(this).attr('data-target',"form-item-7"); $(this).data('target', "form-item-7"); $(this).fadeIn(); ProductNRICTAclickAdobeMulti("Contact Details","NRI_Accounts","Contact Details_Next","Middle","button",formfieldname,campaigndata); } }); $("#nri_email_next").click(function(){ var val =$("#nri_email").val(); var pattern = /^\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/i; var formfieldname=[{"formFieldValue":"", "formFieldName": "Email"}]; if (val === '') { $('.emailErr').css('display', 'block').text('Please enter Email address'); $(this).attr('data-target',"form-item-7"); $(this).fadeIn(); var errorval =[{"errorCode":"400","errorField":"Email ID","errorDescription":"Please enter Email Address"}]; var errorData =[formfieldname,campaigndata,'Email ID_Next','Middle',"button",errorval]; FormAdobeError("Email ID","NRI_Accounts","personal","nr","NRI Banking",errorData); return false; }else if (!pattern.test(val)) { $('.emailErr').css('display', 'block').text('Please enter Email address'); $(this).attr('data-target',"form-item-7"); $(this).fadeIn(); var errorval =[{"errorCode":"400","errorField":"Email ID","errorDescription":"Please enter valid Email Address"}]; var errorData =[formfieldname,campaigndata,'Email ID_Next','Middle',"button",errorval]; FormAdobeError("Email ID","NRI_Accounts","personal","nr","NRI Banking",errorData); return false; }else{ console.log("no error valid"); //$(this).attr('data-target',"form-item-7"); $(this).data('target', "form-item-8"); $(this).fadeIn(); ProductNRICTAclickAdobeMulti("Email ID","NRI_Accounts","Email ID_Next","Middle","button",formfieldname,campaigndata); } }); $('#product_of_interest').on('change', function(){ //alert("dfsd"); var productin = $(this).val(); //console.log("here val"+productin); if (productin === '') { $('.commonErr').css('display', 'block').text('Please select Product'); $('#product_of_interest_next').hide(); var formfieldname=[{"formFieldValue":"", "formFieldName": "Product"}]; var errorval =[{"errorCode":"400","errorField":"Product","errorDescription":"Please select Product"}]; var errorData =[formfieldname,campaigndata, 'Select_Product','Middle',"button",errorval]; FormAdobeError("Product","BusinessBanking_NPA","business","business banking","Business Banking",errorData); return false; }else { $('.commonErr').css('display', 'none'); $(".next-btn").show(); } }); $('.bb_city').on('change', function(){ // alert("dfsd"); var city=""; var city =$('#city :selected').text(); console.log("here val"+city); if (city == '' || city=='Select') { $('.commonErr').css('display', 'block').text('Please select City'); $('#city_next').hide(); var formfieldname=[{"formFieldValue":city, "formFieldName": "City"}]; var errorval =[{"errorCode":"400","errorField":"Product","errorDescription":"Please select City"}]; var errorData =[formfieldname,campaigndata, 'Select_City','Middle',"button",errorval]; FormAdobeError("City","BusinessBanking_NPA","business","business banking","Business Banking",errorData); return false; }else { $('.commonErr').css('display', 'none'); $(".next-btn").show(); } }); //adobe function start here function getMontlyRange(finalincomerange){ finalincomerange =finalincomerange.toString(); if(finalincomerange > 0 && finalincomerange <= 24999){ var salrange ="0-24,999"; }else if(finalincomerange >= 25000 && finalincomerange <= 49999){ var salrange ="25,000-49,999"; }else if(finalincomerange >= 50000 && finalincomerange <= 99999){ var salrange ="50,000-99,999"; }else if(finalincomerange >= 100000 && finalincomerange <= 199999){ var salrange ="100,000-199,999"; }else if(finalincomerange >= 200000 && finalincomerange <= 499999){ var salrange ="200,000-499,999"; }else if(finalincomerange >= 500000 && finalincomerange <= 999999){ var salrange ="500,000-999,999"; }else { var salrange ="1,000,000"; } return salrange; } function getAnnualincomeRange(annualincome){ var finalincomerange_anl =annualincome.toString(); var rangeincome_anl="na"; if(finalincomerange_anl > 0 && finalincomerange_anl <= 499999){ var rangeincome_anl ="0-24,999"; }else if(finalincomerange_anl >= 500000 && finalincomerange_anl <= 999999){ var rangeincome_anl ="500,000-999,999"; }else if(finalincomerange_anl >= 1000000 && finalincomerange_anl <= 1999999){ var rangeincome_anl ="1,000,000-1,999,999"; }else if(finalincomerange_anl >= 2000000 && finalincomerange_anl <= 4999999){ var rangeincome_anl ="2,000,000-4,999,999"; }else if(finalincomerange_anl >= 5000000 && finalincomerange_anl <= 9999999){ var rangeincome_anl ="5,000,000-9,999,999"; }else if(finalincomerange_anl >= 10000000 && finalincomerange_anl <= 19999999){ var rangeincome_anl ="10,000,000-19,999,999"; }else if(finalincomerange_anl >= 20000000 && finalincomerange_anl <= 49999999){ var rangeincome_anl ="20,000,000-49,999,999"; }else if(finalincomerange_anl >= 50000000 && finalincomerange_anl <= 99999999){ var rangeincome_anl ="50,000,000-99,999,999"; }else if(finalincomerange_anl >= 100000000 && finalincomerange_anl <= 200000000){ var rangeincome_anl ="100,000,000-200,000,000"; }else if(finalincomerange_anl >= 200000000){ var rangeincome_anl ="200,000,000"; } return rangeincome_anl; } //adobe function end here function ValidatePLform() { var errorfield ="Title"; var errorfieldmsg ="Data Validation Error"; var flag = true; var title = $('#title').val(); var firstname = $('#fname').val(); var lastname = $('#lname').val(); var gender = $('#gender').val(); var email = $('#email').val(); var education = $('#education').val(); var dob = $('#datepicker').val(); var add1 = $('#add1').val(); var purpose = $('#purpose').val(); var landmark = $('#landmark').val(); var pincode = $('#pincode').val(); var pl_company = $('#pl_employer_name').val(); var emp_type = $('#emp_type').val(); var work_type = $('#work_type').val(); var gross_income = $('#mothly_income').val(); var off_add1 = $('#off_add1').val(); var off_landmark = $('#off_landmark').val(); var off_city = $('#off_city').val(); var pl_pincode = $('#pl_pincode').val(); var pl_app_industry = $('#pl_app_industry').val(); var off_lma = $('#off_lma').val(); var pl_app_gincome = $('#pl_app_gincome').val(); var off_income_total = $('#off_income_total').val(); var ploff_income_other = $('#ploff_income_other').val(); var pan = $('#pan').val(); var start_date = $('#start_date').val(); var dsc_applicant = $('#dsc_applicant').val(); var curr_yr_tax = $('#curr_yr_tax').val(); var cygt = $('#cygt').val(); var itr_audited = $('.itr_audited').val(); var pyti = $('#pyti').val(); var mod_salary = $('#mod_salary').val(); var profession = $('#profession').val(); var director_val = $('#director_val').val(); var reference_name1 = $('#reference_name1').val(); var reference_phone1 = $('#reference_phone1').val(); var reference_name2 = $('#reference_name2').val(); var reference_phone2 = $('#reference_phone2').val(); // var document_type = $('#document_type').val(); var document_type = $('#document_type').val(); var current_year_taxable_income = $('#current_year_taxable_income').val(); var totexp = $('#totexp').val(); var pattern = /^\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/i; var zipregex = /^\d{6}$/i; var panregex = /[A-Z]{5}[0-9]{4}[A-Z]{1}$/; var phno = /^\d{10}$/ if(firstname == ''){ alert('Please enter First Name'); $('#fname').focus(); errorfieldmsg ="First Name cannot be blank!!"; errorfield="First Name"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(lastname == ''){ alert('Please enter the Last Name'); $('#lname').focus(); errorfieldmsg ="Please enter the Last Name"; errorfield="Last Name"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(title == ''){ alert('Please select the Title'); $('#title').focus(); errorfieldmsg ="Title cannot be blank!"; errorfield="Title"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(gender == ''){ alert('Select the Gender'); $('#gender').focus(); errorfieldmsg ="Gender cannot be blank!!"; errorfield="Gender"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(email == ''){ alert('Please enter Email Address'); $('#email').focus(); errorfieldmsg ="Email cannot be blank!!"; errorfield="Email"; flag = false; return [flag,errorfield,errorfieldmsg]; }else if(!pattern.test(email)) { alert('Not a valid e-mail address'); $('#email').focus(); errorfieldmsg ="Email cannot be blank!!"; errorfield="Email"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(education == '' || education == 'Select'){ alert('Please select the Education'); $('#education').focus(); errorfieldmsg ="Education cannot be blank!!"; errorfield="Education"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(dob == ''){ alert('Please select the DOB'); $('#datepicker').focus(); errorfieldmsg ="DOB cannot be blank!!"; errorfield="DOB"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(add1 == ''){ alert('Please enter Address Line 1'); $('#add1').focus(); errorfieldmsg ="Address1 cannot be blank!!"; errorfield="Address Line1"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(purpose == '' || purpose == 'Select'){ alert('Please select the Purpose of loan'); errorfieldmsg ="Purpose of Loan cannot be blank!!"; errorfield="Purpose of Loan"; $('#purpose').focus(); flag = false; return [flag,errorfield,errorfieldmsg]; } // if(landmark == ''){ // alert('Landmark of loan cannot be blank!!'); // $('#landmark').focus(); // errorfieldmsg ="Landmark of loan cannot be blank!!"; // errorfield="Landmark"; // flag = false; // return [flag,errorfield,errorfieldmsg]; // } if(pincode === '') { alert('Please enter the Pincode'); $('#pincode').focus(); errorfieldmsg ="Please enter the Pincode"; errorfield="Zip"; return [flag,errorfield,errorfieldmsg]; } if(pl_company == ''){ alert('Please enter the Company Name'); $('#pl_company').focus(); errorfieldmsg ="Please enter the Company Name"; errorfield="Company/Employer"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(emp_type == '' || emp_type == 'Select'){ alert('Please select the Employment Type'); $('#emp_type').focus(); errorfieldmsg ="Please select the Occupation"; errorfield="Employment type"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(work_type == '' || work_type == 'Select'){ alert('Please select the Work Type'); $('#work_type').focus(); errorfieldmsg ="Please select the Work type"; errorfield="work Type"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(emp_type == '4' || emp_type == '5' || emp_type == '6'){ if(gross_income == '' ) { alert('Please provide Gross Montly Income'); $('#gross_income').focus(); errorfieldmsg ="Please provide Gross Montly Income"; errorfield="Net Montly"; flag = false; return [flag,errorfield,errorfieldmsg]; } } if(off_add1 == ''){ alert('Please enter the Office Address'); $('#off_add1').focus(); errorfieldmsg ="Please select the Office Address of loan"; errorfield="Office Address"; flag = false; return [flag,errorfield,errorfieldmsg]; } // if(off_landmark == ''){ // alert('Office Landmark cannot be blank!!'); // $('#off_landmark').focus(); // errorfieldmsg ="Office Landmark of loan cannot be blank!!"; // errorfield="Office Landmark"; // flag = false; // return [flag,errorfield,errorfieldmsg]; // } if(pl_pincode == '') { alert('Please enter the Office Pincode'); $('#pl_pincode').focus(); errorfieldmsg ="Office Pincode cannot be blank!!"; errorfield="Office Pincode"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(off_city == '' || off_city == 'Select'){ alert('Office City cannot be blank!!'); $('#off_city').focus(); errorfieldmsg ="Office City cannot be blank!!"; errorfield="Office City"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(pl_app_industry == '' || pl_app_industry == 'Select') { alert('Industry(ISIC) must not be blank'); $('#pl_app_industry').focus(); errorfieldmsg ="ISIC cannot be blank!!"; errorfield="ISIC"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(off_lma == '' || off_lma == 'Select') { alert('Loan mailing address must not be blank'); $('#off_lma').focus(); errorfieldmsg ="Loan mailing address cannot be blank!!"; errorfield="Loan mailing address"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(pl_app_gincome == '' ) { alert('Annual gross income must not be blank'); $('#pl_app_gincome').focus(); errorfieldmsg ="Annual gross income cannot be blank!!"; errorfield="Annual gross income"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(off_income_total == '' ) { alert('Total income must not be blank'); $('#off_income_total').focus(); errorfieldmsg ="Total income cannot be blank!!"; errorfield="Total Income"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(ploff_income_other == '' ) { alert('Other income must not be blank'); $('#ploff_income_other').focus(); errorfieldmsg ="Landmark of loan cannot be blank!!"; errorfield="Landmark"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(emp_type == '2' || emp_type == '3'){ if(start_date == '' ) { alert('Start date for current Business/Profession must not be blank'); $('#start_date').focus(); errorfieldmsg ="Start date for current Business cannot be blank!!"; errorfield="Start date for current Business"; flag = false; return [flag,errorfield,errorfieldmsg]; } } if(emp_type == '2'){ if(dsc_applicant == '' || dsc_applicant == 'Select') { alert('Choose option that best describes applicant must not be blank'); $('#dsc_applicant').focus(); errorfieldmsg ="Choose option that best describes applicant cannot be blank!!"; errorfield="Choose option that best describes applicant"; flag = false; return [flag,errorfield,errorfieldmsg]; } } if(emp_type == '2' || emp_type == '3'){ if(curr_yr_tax == '') { alert('Current year taxable income must not be blank'); $('#curr_yr_tax').focus(); errorfieldmsg ="Current year taxable income cannot be blank!!"; errorfield="Current year taxable income"; flag = false; return [flag,errorfield,errorfieldmsg]; } } if(emp_type == '2') { if(cygt == '') { alert('Current year gross turnover must not be blank'); $('#cygt').focus(); errorfieldmsg ="Current year gross turnover cannot be blank!!"; errorfield="Current year gross turnover"; flag = false; return [flag,errorfield,errorfieldmsg]; } } if(itr_audited == '') { alert('Is current year ITR audited must not be blank'); $('.itr_audited').focus(); errorfieldmsg ="Is current year ITR cannot be blank!!"; errorfield="Is current year ITR"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(emp_type == '2' || emp_type == '3'){ if(pyti == '') { alert('Previous year taxable income must not be blank'); $('#pyti').focus(); errorfieldmsg ="Previous year taxable cannot be blank!!"; errorfield="Previous year taxable"; flag = false; return [flag,errorfield,errorfieldmsg]; } } if(emp_type == '3'){ if(profession == '' || profession == '0') { alert('Occupation Type must not be blank'); $('#profession').focus(); errorfieldmsg ="Occupation cannot be blank!!"; errorfield="Occupation"; flag = false; return [flag,errorfield,errorfieldmsg]; } } if(emp_type == '3'){ if(current_year_taxable_income == '' ) { alert('Current year business income must not be blank'); $('#current_year_taxable_income').focus(); errorfieldmsg ="Current year business income cannot be blank!!"; errorfield="Current year business income"; flag = false; return [flag,errorfield,errorfieldmsg]; } } //if(emp_type == '6'){ if(totexp == '' ) { alert('Total Work Experience must not be blank'); $('#totexp').focus(); errorfieldmsg ="Total Work Experience must not be blank"; errorfield="Total Experience"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(reference_name1 == ''){ alert('Please enter Reference Name in First row'); $('#reference_name1').focus(); errorfieldmsg ="Please enter Reference Name in First row"; errorfield="reference_name1"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(reference_phone1 == ''){ alert('Please enter Reference Phone Number1'); $('#reference_phone1').focus(); errorfieldmsg ="Please enter Reference Phone Number1"; errorfield="reference_phone1"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(reference_name2 == ''){ alert('Please enter Reference Name in second one'); $('#reference_name2').focus(); errorfieldmsg ="Please enter Reference Name in second row"; errorfield="reference_name2"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(reference_phone2 == ''){ alert('Please enter Reference Phone Number2'); $('#reference_phone2').focus(); errorfieldmsg ="Please enter Reference Phone Number1"; errorfield="reference_phone2"; flag = false; return [flag,errorfield,errorfieldmsg]; } if($('input[name=director_val]:checked').length == 0) { alert('select the Director / Relative of Director of any bank'); $('#totexp').focus(); errorfieldmsg ="Director / Relative of Director of any bank"; errorfield="Director Option"; flag = false; return [flag,errorfield,errorfieldmsg]; } if(!panregex.test(pan)){ alert("invalid PAN no"); $('#pan').focus(); //return panregex.test(pan); errorfieldmsg ="Invalid Pan No!!"; errorfield="PAN NO"; flag = false; return [flag,errorfield,errorfieldmsg]; } return [flag,errorfield,errorfieldmsg]; } //PL Validation end here //PL PA check $('.chkmobileUser').on('change', function(){ var utm_source=""; var source_type=""; var ag_title =""; var custmobile =$(this).val(); var utm_source =$("#utm_source").val(); var utm_param =$("#utm_param").val(); var source_type =$("#source_type").val(); var ag_title =$("#source_typetitle").val(); var ptype ="PL"; if(custmobile.length==10){ console.log("pinCC"+custmobile.length+utm_source); validateBankCustomerMobile(custmobile,ptype,utm_source,utm_param,ag_title,source_type); } }); function validateBankCustomerMobile(cmob,ptype,utm_source,utm_param,ag_title,source_type){ // alert("inside fuction"); var phno = /^\d{10}$/ var formfielmob={"formFieldValue":"na", "formFieldName": "na"}; if(cmob==""){ $('.mblErr').css('display', 'block').text('Invalid mobile number'); $(".next-btn").hide(); return false; }else if(!cmob.match(phno)) { $('.mblErr').css('display', 'block').text('Invalid mobile number'); $(".next-btn").hide(); return false; }else{ $('.next-btn').hide(); $('.mblWait').show(); var data = "cmobile="+cmob+"&post_type=preapproved&p="+ptype+"&utm_source="+utm_source+"&utm_all="+utm_param+"&d="+source_type+"&ag="+ag_title; var pid="na"; $.ajax({ url:"https://apply.standardchartered.co.in/apis/form-api-general/", type: 'GET', data: data, dataType: "json", success:function(response){ if(response.status=="1"){ $('.mblWait').hide(); ProductPLCTAclickAdobeMulti("Mobile Number","PA","Mobile Number_Next","Middle","button",formfielmob,campaigndata); window.location =root+"personal-loan/pre-approved-offer/?m="+cmob+"&u="+response.uid; }else if(response.status=="0"){ // ProductPLCTAclickAdobe("Existing Relationship","PL_ETB",cmob,utm_campaign,"existing_relationship_yesorno"); alert(response.apimsg); $('.next-btn').hide(); return false; }else{ //alert("else here"); return false; // $('.next-btn').attr("data-target","form-item-7"); ProductPLCTAclickAdobeMulti("Mobile Number","PL Ultimedia_NTB","Mobile Number_Next","Middle","button",formfielmob,campaigndata); $('.next-btn').show(); $('.mblWait').hide(); return false; } }, error:function(error){ console.log(error); } }); return false; } } //PL validation LP form $('#pl_emptype_next').click(function(){ //console.log("hereim"); var emptype = $("#pl_emptype").val(); //console.log("hereim"+emptype); if (emptype =="") { $(this).data('target',"form-item-7"); var targetid ="form-item-7"; $('.empErr').css('display', 'block').text('Please select Employment Type'); }else { $('.empErr').hide(); if(emptype=="1"){ var targetid ="form-item-8"; }else{ var targetid ="form-item-12"; } $(this).data('target',targetid); } $(".form-item").removeClass("active"); $("."+targetid).addClass("active"); }); $('#pl_employer_name_next').click(function(){ //console.log("hereim"); var emptype = $("#pl_employer_name").val(); //console.log("hereim"+emptype); if (emptype =="") { var targetid ="form-item-8"; $('.commonErr').css('display', 'block').text('Enter Employer Name'); }else { $('.commonErr').css('display', 'none').text(''); var targetid="form-item-9"; } $(this).data('target',targetid); $(".form-item").removeClass("active"); $("."+targetid).addClass("active"); }); $('#industry_next').click(function(){ //var industry = $("#pl_off_industry").val(); var panregex = /[A-Z]{5}[0-9]{4}[A-Z]{1}$/; var pan =$("#pl_pan").val(); if (pan =="") { var targetid ="form-item-9"; $('.commonErr').css('display', 'block').text('Please enter PAN'); }else if(!panregex.test(pan)){ $('.commonErr').css('display', 'block').text('Please enter Valid PAN'); var targetid ="form-item-9"; }else { $('.commonErr').css('display', 'none').text(''); var targetid ="form-item-10"; } $(this).data('target',targetid); $(".form-item").removeClass("active"); $("."+targetid).addClass("active"); }); $('#current_location_next').click(function(){ var curlocation = $("#current_location").val(); if (curlocation =="") { var targetid ="form-item-10"; $('.commonErr').css('display', 'block').text('Enter Select Current Location'); }else { $('.commonErr').css('display', 'none').text(''); var targetid="form-item-6"; } $(this).data('target',targetid); $(".form-item").removeClass("active"); $("."+targetid).addClass("active"); }); //PL validation LP form end here //PL PA check end here