1function validate_form(event,form){ 2 if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; } 3 4 let emailInput = jQuery(form.inf_field_Email); 5 let formMessage = jQuery(form).find('.form-message'); 6 7 formMessage.fadeOut(); 8 9 var rp = /^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$/; // phone validator: xxx xxx xxxx 10 var phoneValidated = true; 11 var phone = jQuery(form).find( '[name]' ).each( function( i , v ) { 12 var input = jQuery( this ), // resolves to current input element. 13 name = input.attr( 'name' ), 14 required = input.attr( 'required' ), 15 type = input.attr( 'type' ), 16 value = jQuery.trim(input.val()); 17 if ((type === 'phone' || name === 'phone' || name === 'inf_field_Phone5' || name === 'inf_field_Phone3') && value !== '' && !rp.test(value)) { 18 phoneValidated = false; 19 } 20 }); 21 if(!phoneValidated){ 22 msg = 'Phone number must be a valid USA or Canadian number, DO NOT include the country code'; 23 formMessage.text(msg); 24 formMessage.fadeIn(); 25 return false; 26 } 27 28 if(emailcheck(emailInput.val())){ 29 let submitInput = jQuery(form).find('input[type="submit"]'); 30 let loadingImg = jQuery(form).find('.loading-img'); 31 32 submitInput.attr('disabled', 'disabled'); 33 submitInput.addClass('disabled'); 34 loadingImg.show(); 35 36 var request_data = { 37 email: jQuery(form.inf_field_Email).val(), 38 verify: 'YCiICEUTYXKaSFIuXWR3' 39 }; 40 jQuery.ajax({ 41 type: "POST", 42 url: "/verif/brite.php", 43 data: request_data, 44 cache: false, 45 dataType: 'json', 46 success: function(html) { 47 if(html.success === 'valid') 48 { 49 emailInput.attr('readonly', true); 50 createCookie('freesignup',emailInput.val(),3000); 51 var url_post = 'https://mr141.infusionsoft.com/app/form/process/' + jQuery(form.inf_form_xid).val(); 52 jQuery(form).attr('action',url_post); 53 var formData = jQuery(form.inf_form_xid).serialize(); 54 jQuery(form).removeAttr('onsubmit').submit(); 55 }else{ 56 msg = 'The email account you entered does not exist'; 57 loadingImg.hide(); 58 formMessage.text(msg); 59 formMessage.fadeIn(); 60 submitInput.removeAttr("disabled", "disabled"); 61 submitInput.removeClass('disabled'); 62 } 63 }, 64 error: function(html){ 65 msg = 'There is a problem with the script, we cannot process your request'; 66 loadingImg.hide(); 67 formMessage.text(msg); 68 formMessage.fadeIn(); 69 submitInput.removeAttr("disabled", "disabled"); 70 submitInput.removeClass('disabled'); 71 } 72 }); 73 }else{ 74 msg = 'The email address you entered is invalid'; 75 formMessage.text(msg); 76 formMessage.fadeIn(); 77 } 78} 79 80 81 82function emailcheck(str) { 83 var at="@"; 84 var dot="."; 85 var lat=str.indexOf(at); 86 var lstr=str.length; 87 var ldot=str.indexOf(dot); 88 if (str.indexOf(at)==-1){return false;} 89 if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){return false;} 90 if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){return false;} 91 if (str.indexOf(at,(lat+1))!=-1){return false;} 92 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){return false;} 93 if (str.indexOf(dot,(lat+2))==-1){return false;} 94 if (str.indexOf(" ")!=-1){return false;} 95 return true; 96} 97 98 99function createCookie(name,value,days) { 100 if (days) { 101 var date = new Date(); 102 date.setTime(date.getTime()+(days*24*60*60*1000)); 103 var expires = "; expires="+date.toGMTString(); 104 } 105 else var expires = ""; 106 document.cookie = name+"="+value+expires+"; path=/"; 107} 108 109function readCookie(name) { 110 var nameEQ = name + "="; 111 var ca = document.cookie.split(';'); 112 for(var i=0;i < ca.length;i++) { 113 var c = ca[i]; 114 while (c.charAt(0)==' ') c = c.substring(1,c.length); 115 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 116 } 117 return null; 118} 119 120function eraseCookie(name) { 121 createCookie(name,"",-1); 122} 123 124function iCreateCookie(cname,cvalue,expdays) 125 { 126 if (expdays) 127 { 128 var dt = new Date(); 129 dt.setTime(dt.getTime()+(expdays*24*60*60*1000)); 130 var expires = "; expires="+dt.toGMTString(); 131 } 132 else 133 { 134 var expires = ""; 135 } 136 document.cookie = cname + "=" + cvalue + expires + "; path=/"; 137} 138 139function iDeleteCookieCookie(cname) 140{ 141 document.cookie = cname + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 142} 143 144function iReadCookie(c1) 145{ 146 c1 += "="; 147 var ca = document.cookie.split(';'); 148 for(var j = 0; j < ca.length; j++) 149 { 150 var c = ca[j]; 151 while (c.charAt(0) == ' ') 152 { 153 c = c.substring(1, c.length); 154 } 155 if (c.indexOf(c1) == 0) 156 { 157 return c.substring(c1.length,c.length); 158 } 159 } 160 return null; 161} 162 163function iRetrieveCookieValue(c1) 164{ 165 cookievalue = iReadCookie(c1); // read the cookie value 166 167 if (cookievalue != null) 168 { 169 return cookievalue; // if the value is not null, return it 170 } 171 172 return null; 173} 174 175function validate_form_new(event,form){ 176 if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; } 177 178 let emailInput = jQuery(form.inf_field_Email); 179 let formMessage = jQuery(form).find('.form-message'); 180 181 formMessage.fadeOut(); 182 183 var rp = /^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$/; // phone validator: xxx xxx xxxx 184 var phoneValidated = true; 185 var phoneFilled = false;
186 var cookiePath = jQuery(form).find( '[name="cookie"]' ); 187 var cookiePhone = jQuery(form).find( '[name="cookiephone"]' ); 188 var phone = jQuery(form).find( '[name]' ).each( function( i , v ) { 189 var input = jQuery( this ), // resolves to current input element. 190 name = input.attr( 'name' ), 191 required = input.attr( 'required' ), 192 type = input.attr( 'type' ), 193 value = jQuery.trim(input.val()); 194 if ((type === 'tel' || name === 'phone' || name === 'inf_field_Phone5' || name === 'inf_field_Phone3') && value !== '') { 195 phoneFilled = true; 196 if(!rp.test(value)){ 197 phoneValidated = false; 198 } 199 } 200 }); 201 if(!phoneValidated){ 202 msg = 'Phone number must be a valid USA or Canadian number, DO NOT include the country code'; 203 formMessage.text(msg); 204 formMessage.fadeIn(); 205 return false; 206 } 207 208 if(emailcheck(emailInput.val())){ 209 let submitInput = jQuery(form).find('input[type="submit"]'); 210 let loadingImg = jQuery(form).find('.loading-img'); 211 212 submitInput.attr('disabled', 'disabled'); 213 submitInput.addClass('disabled'); 214 loadingImg.show(); 215 216 var request_data = { 217 email: jQuery(form.inf_field_Email).val(), 218 verify: 'YCiICEUTYXKaSFIuXWR3' 219 }; 220 jQuery.ajax({ 221 type: "POST", 222 url: "/verif/brite.php", 223 data: request_data, 224 cache: false, 225 dataType: 'json', 226 success: function(html) { 227 if(html.success === 'valid') 228 { 229 emailInput.attr('readonly', true); 230 var url_post = 'https://mr141.infusionsoft.com/app/form/process/' + jQuery(form.inf_form_xid).val(); 231 jQuery(form).attr('action',url_post); 232 var formData = jQuery(form.inf_form_xid).serialize(); 233 if(cookiePath.val()){ 234 iCreateCookie(cookiePath.val(), 1, 30); 235 } 236 if(cookiePhone.val() && phoneFilled){ 237 iCreateCookie(cookiePhone.val(), 1, 30); 238 } 239 iCreateCookie(emailInput.val(), 1, 90); 240 dataLayer.push({'event': 'isoft_form_submitted'}); 241 jQuery(form).removeAttr('onsubmit').submit(); 242 }else{ 243 msg = 'The email account you entered does not exist'; 244 emailInput.parent().show(); 245 loadingImg.hide(); 246 formMessage.text(msg); 247 formMessage.fadeIn(); 248 submitInput.removeAttr("disabled", "disabled"); 249 submitInput.removeClass('disabled'); 250 } 251 }, 252 error: function(html){ 253 msg = 'There is a problem with the script, we cannot process your request'; 254 loadingImg.hide(); 255 formMessage.text(msg); 256 formMessage.fadeIn(); 257 submitInput.removeAttr("disabled", "disabled"); 258 submitInput.removeClass('disabled'); 259 } 260 }); 261 }else{ 262 msg = 'The email address you entered is invalid'; 263 emailInput.parent().show(); 264 formMessage.text(msg); 265 formMessage.fadeIn(); 266 } 267}
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.