1// Autofilling Forms 2afdelay = 2000; // Delay before filling in form (to do it after the browser autofill happens) 3 4// For Marketo Forms 5/* 6$("#Email", mktoObj).addClass("email"); 7$("#FirstName", mktoObj).addClass("firstname"); 8$("#LastName", mktoObj).addClass("lastname"); 9$("#Company", mktoObj).addClass("company"); 10$("#Phone", mktoObj).addClass("phone"); 11$("#Country", mktoObj).addClass("country"); 12$("#Industry", mktoObj).addClass("industry"); 13*/ 14 15function autoFillNMI() { 16 // Get Marketo Data from Cookie 17 fcMarketo = getCookie("marketo"); 18 if(typeof(fcMarketo) != "undefined") { 19 fcMarketo = JSON.parse(fcMarketo); 20 } else { fcMarketo = null; } 21 22 f = []; // To save the fields that exist on the page 23 24 // First Name 25 if ( $(".firstname").length > 0 ) { 26 setTimeout(function() { 27 if(fcMarketo != null && $(".firstname").val() == "") $(".firstname").val(fcMarketo[0].FirstName); 28 }, afdelay); 29 f.push($(".firstname")); 30 } 31 32 // Last Name 33 if ( $(".lastname").length > 0 ) { 34 setTimeout(function() { 35 if(fcMarketo != null && $(".lastname").val() == "") $(".lastname").val(fcMarketo[0].LastName); 36 }, afdelay); 37 f.push($(".lastname")); 38 } 39 40 // Company 41 if ( $(".company").length > 0 ) { 42 setTimeout(function() { 43 if(fcMarketo != null && $(".company").val() == "") $(".company").val(fcMarketo[0].Company); 44 }, afdelay); 45 f.push($(".company")); 46 } 47 48 // Phone 49 if ( $(".phone").length > 0 ) { 50 setTimeout(function() { 51 if(fcMarketo != null && $(".phone").eq(0).val().length < 7) $(".phone").val(fcMarketo[0].Phone); 52 }, afdelay); 53 f.push($(".phone")); 54 } 55 56 // Email 57 if ( $(".email").length > 0) { 58 setTimeout(function() { 59 if(fcMarketo != null && $(".email").val() == "") $(".email").val(fcMarketo[0].Email); 60 if($(".email").val() == "") { 61 email = getCookie("email"); 62 $(".email").val(email); 63 } 64 }, afdelay); 65 f.push($(".email")); 66 } 67 68 // Country 69 if ( $(".country").length > 0 ) { 70 fcLocation = getCookie("location"); 71 if(typeof(fcLocation) != "undefined") { 72 setTimeout(function() { 73 if(fcLocation != null) { 74 if(typeof fcLocation == "string") fcLocation = JSON.parse(fcLocation) 75 selCountry = fcLocation.country; 76 selCountry = selCountry.toUpperCase().replace(/\+/g," "); 77 $("option",".country").each(function(){ 78 if($(this).val().substring(2,3) == "_") { 79 cntry = $(this).val().substring(3).toUpperCase(); 80 } else { 81 cntry = $(this).val().toUpperCase(); 82 } 83 if(cntry == selCountry) { 84 $(this).prop('selected', true); 85 } 86 }); 87 } 88 }, afdelay); 89 } 90 f.push($(".country")); 91 } 92 93 // Industry 94 if ( $(".industry").length > 0 ) { 95 setTimeout(function() { 96 if(fcMarketo != null && $(".industry").val() == "") $(".industry").val(fcMarketo[0].Industry.replace(/\+/g," ")); 97 }, afdelay); 98 f.push($(".industry")); 99 } 100} 101 102autoFillNMI();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.