1function checkPassword(password) { 2 let valid = false; 3 const pw = password.value.trim(); 4 if (!isRequired_3(pw)) { 5 showError_3(password, "This field is mandatory"); 6 } else if (password.value.length < 2) { 7 showError_3(password, "Password should contain atleast one special character, capital and number"); 8 } else { 9 showSuccess_3(password); 10 valid = true; 11 } 12 return valid; 13 } 14 15function checkConfirmPassword(confirm_password) { 16 let valid = false; 17 const cfpw = confirm_password.value.trim(); 18 const pw = document.getElementById("enq-password").value.trim(); 19 if (!isRequired_3(cfpw)) { 20 showError_3(confirm_password, "This field is mandatory"); 21 } else if (cfpw != pw) { 22 showError_3(confirm_password, "Confirm Password should be same as password"); 23 } else { 24 showSuccess_3(confirm_password); 25 valid = true; 26 } 27 return valid; 28 } 29 30 function ConfirmemailValidation( 31 form, 32 email, 33 firstname, 34 lastname, 35 password, 36 confirm_password, 37 ) { 38 var necolldata = ""; 39 40 var email_valid = document.getElementById("enq-email").value; 41 42 if (email_valid != "") { 43 jQuery.ajax({ 44 url: "/wp-content/themes/goodlife-wp-B2B/validations/email_check.php", 45 data: { 46 'email': email_valid, 47 }, 48 dataType: 'json', 49 success: function(data) { 50 if( data.result == true ) { 51 //jQuery('This Email already exists').appendTo('#email_check'); 52 jQuery('#email_check').text('User Account already exists with this email id'); 53 } 54 }, 55 error: function(data) { 56 //error 57 } 58 }); 59 60 } 61 62 checkEmail(email); 63 checkFirstName(firstname); 64 checkLastName(lastname); 65 checkPassword(password); 66 checkConfirmPassword(confirm_password); 67 68 69 formValid = 70 //finalEmailCheck && 71 checkEmail(email) && 72 checkFirstName(firstname) && 73 checkLastName(lastname) && 74 checkPassword(password) && 75 checkConfirmPassword(confirm_password); 76 } 77 78 function ConfirmValidation( 79 form, 80 company, 81 country, 82 industry, 83 //jobtitle, 84 //jobfunction, 85 consent = false 86 ) { 87 88 checkCompany(company); 89 checkCountry(country); 90 checkIndustry(industry); 91 92 93 formValid = 94 checkCompany(company) && 95 checkCountry(country) && 96 checkIndustry(industry); 97 } 98 99function ReportformValidation( 100 form, 101 email, 102 firstname, 103 lastname, 104 password, 105 confirm_password, 106 company, 107 country, 108 industry, 109 //jobtitle, 110 //jobfunction, 111 consent = false 112 ) { 113 var necolldata = ""; 114 var email_valid = document.getElementById("enq-email-vms").value; 115 116 if (email_valid != "") { 117 jQuery.ajax({ 118 url: "/wp-content/themes/goodlife-wp-B2B/validations/email_check.php", 119 data: { 120 'email': email_valid, 121 }, 122 dataType: 'JSON', 123 success: function(data) { 124 if( data.result == true ) { 125 //jQuery('This Email already exists').appendTo('#email_check'); 126 jQuery('#email_check').text('User Account already exists with this email id'); 127 } 128 }, 129 error: function(data) { 130 //error 131 } 132 }); 133 } 134 135 checkEmail(email); 136 checkFirstName(firstname); 137 checkLastName(lastname); 138 checkPassword(password); 139 checkConfirmPassword(confirm_password); 140 checkCompany(company); 141 checkCountry(country); 142 checkIndustry(industry); 143 //checkJobTitle(jobtitle); 144 //checkFunction(jobfunction); 145 //checkGdpr(consent); 146 147 formValid = 148 //finalEmailCheck && 149 checkEmail(email) && 150 checkFirstName(firstname) && 151 checkLastName(lastname) && 152 checkPassword(password) && 153 checkConfirmPassword(confirm_password) && 154 checkCompany(company) && 155 checkCountry(country) && 156 //checkJobTitle(jobtitle); 157 //checkFunction(jobfunction); 158 checkIndustry(industry); 159 160 if (formValid) { 161 var form_Id = form.id; 162 var recaptcha = document.getElementById("recaptch_secret_key").value; 163 164 if (recaptcha != "") { 165 jQuery.ajax({ 166 url: "/wp-content/plugins/vms-automation-gd/captcha.php", 167 data: jQuery("form#reportvalidation").serialize(), 168 type: "POST", 169 complete: function (response) { 170 let data_captcha = JSON.parse(response.responseText); 171 if (data_captcha.status == "success") { 172 173 174 175 document.querySelector('#reportvalidation .thank-you-stage').style.cssText = 'display: block; min-height: 0; max-height: none; height: auto;'; 176 177 178 // console.log(jQuery("form#reportvalidation").serialize()); 179 jQuery.ajax({ 180 url: "/wp-content/themes/goodlife-wp-B2B/report_ajaxcall.php", 181 data: jQuery("form#reportvalidation").serialize(), 182 type: "POST", 183 success: function (data) { 184 console.log("form submitted to curl ", data); 185 }, 186 error: function (ex) { 187 console.log("form not submitted to curl"); 188 }, 189 }); 190 191 //li.style.display = "none"; 192 jQuery('.form_register').hide(); 193 // jQuery('.thank-you-stage').show(); 194 195 } else { 196 document.getElementById("captcha").innerHTML = "Invalid Captcha"; 197 } 198 }, 199 error: function (ex) { 200 document.getElementById("captcha").innerHTML = 201 "form not submitted to curl"; 202 }, 203 }); 204 } else { 205 document.getElementById("captcha").innerHTML = "Please select Captcha"; 206 } 207 } else { 208 // if (!newsletterSubmitBtn.classList.contains("disabled")) { 209 // newsletterSubmitBtn.classList.add("disabled"); 210 // } 211 return false;
212 } 213 214 const debounce = (fn, delay = 500) => { 215 let timeoutId; 216 return (...args) => { 217 // cancel the previous timer 218 if (timeoutId) { 219 clearTimeout(timeoutId); 220 } 221 // setup a new timer 222 timeoutId = setTimeout(() => { 223 fn.apply(null, args); 224 }, delay); 225 }; 226 }; 227 228 form.addEventListener( 229 "input", 230 debounce(function (e) { 231 switch (e.target.id) { 232 case "enq-email": 233 checkEmail(email); 234 break; 235 case "enq-first-name": 236 checkFirstName(firstname); 237 break; 238 case "enq-last-name": 239 checkLastName(lastname); 240 break; 241 case "enq-company": 242 checkCompany(company); 243 break; 244 case "enq-industry": 245 checkCompany(industry); 246 break; 247 case "enq-job-title": 248 checkJobTitle(jobtitle); 249 break; 250 case "enq-job-function": 251 checkJobTitle(jobfunction); 252 break; 253 case "enq-country": 254 checkCountry(country); 255 break; 256 case "enq-phone": 257 checkPhone(phone); 258 break; 259 case "enq-message": 260 checkMessage(enquiry); 261 break; 262 case "enq-gdpr": 263 checkGdpr(consent); 264 break; 265 } 266 }) 267 ); 268 } 269 270 function ConfirmloginValidation( 271 form, 272 email, 273 password, 274 ) { 275 var necolldata = ""; 276 checkEmail(email); 277 checkPassword(password); 278 279 280 formValid = 281 //finalEmailCheck && 282 checkEmail(email) && 283 checkPassword(password); 284 285 if (formValid) { 286 var form_Id = form.id; 287 var email_valid = document.getElementById("enq-email-vms").value; 288 var password_valid = document.getElementById("enq-password-vms").value; 289 290 if (email_valid != "" && password_valid != "") { 291 jQuery.ajax({ 292 url: "/wp-content/themes/goodlife-wp-B2B/validations/login_validations.php", 293 data: { 294 'email': email_valid, 295 'password': password_valid, 296 }, 297 dataType: 'JSON', 298 success: function (data) { 299 if (data.result == true) { 300 console.log(jQuery("form#create-account-form").serialize()); 301 jQuery.ajax({ 302 url: "/wp-content/themes/goodlife-wp-B2B/report_ajaxcall.php", 303 data: jQuery("form#create-account-form").serialize(), 304 type: "POST", 305 success: function (data) { 306 console.log("form submitted to curl ", data); 307 308 document.querySelector('form#create-account-form .thank-you-stage').style.cssText = 'display: block; min-height: 0; max-height: none; height: auto;'; 309 310 311 }, 312 error: function (ex) { 313 console.log("form not submitted to curl"); 314 }, 315 }); 316 317 //li.style.display = "none"; 318 jQuery('#login_details').hide(); 319 //jQuery('.thank-you-stage').show(); 320 document.querySelector('.sponsored-whitepaper .sponsored-whitepaper-container .content .thank-you-stage').setAttribute('style', 'display: block, min-height: 0; max-height: none; height: auto;'); 321 } else { 322 //document.getElementById("captcha").innerHTML = "Invalid Captcha"; 323 jQuery('#login_validations').text('The password/username you entered is incorrect.Please check and enter correct details. '); 324 } 325 }, 326 error: function (ex) { 327 console.log('form not submitted to curl'); 328 }, 329 }); 330 } else { 331 document.getElementById("login_validations").innerHTML = "Please enter Email and password"; 332 } 333 } else { 334 // if (!newsletterSubmitBtn.classList.contains("disabled")) { 335 // newsletterSubmitBtn.classList.add("disabled"); 336 // } 337 return false;
338 } 339 } 340 341 // // Activate submit button after validate the form 342 343jQuery(document).ready(function() { 344 jQuery('#login_here').click(function() { 345 jQuery('.new-user').show(); 346 jQuery('.existing-user').hide(); 347 }); 348 jQuery('#sign_up_here').click(function() { 349 jQuery('.new-user').hide(); 350 jQuery('.existing-user').show(); 351 }); 352});
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.