1$(document).ready(function () { 2 /*gets the page URL and determine if practice area dropdown validation (validatePADropdown function) is needed. - Gad */ 3 // var validation_url = location.pathname; 4 $("input#phone").bind("keypress keyup blur", function (e) { 5 var isAndroid = /android/i.test(navigator.userAgent.toLowerCase()); 6 7 if (isAndroid) { 8 onlyAcceptNumberInput($(this)) 9 } 10 var inp = String.fromCharCode(e.keyCode); 11 if (/[a-zA-Z0-9-_ ]/.test(inp)) { 12 onlyAcceptNumberInput($(this)) 13 } 14 }).each(function () { 15 if ($(this).val().length > 0) { 16 onlyAcceptNumberInput($(this)) 17 } 18 }); 19 20 //PRJ-202308-0256: Form update for Zoominfo implementation 21 $("input#ZIphone").bind("keypress keyup blur", function (e) { 22 var isAndroid = /android/i.test(navigator.userAgent.toLowerCase()); 23 24 if (isAndroid) { 25 onlyAcceptNumberInput($(this)) 26 } 27 var inp = String.fromCharCode(e.keyCode); 28 if (/[a-zA-Z0-9-_ ]/.test(inp)) { 29 onlyAcceptNumberInput($(this)) 30 } 31 }).each(function () { 32 if ($(this).val().length > 0) { 33 onlyAcceptNumberInput($(this)) 34 } 35 }); 36 //end of PRJ-202308-0256 37 38 $("input[name='first_name']").bind("keypress keyup blur", function(e){ 39 var inp = String.fromCharCode(e.keyCode); 40 if(/[0-9]/.test(inp)) { 41 removeNumber($(this)); 42 } 43 }); 44 45 $("input[name='last_name']").bind("keypress keyup blur", function(e){ 46 var inp = String.fromCharCode(e.keyCode); 47 if(/[0-9]/.test(inp)) { 48 removeNumber($(this)); 49 } 50 }); 51 52 53 /*keypress functions*/ 54 $("select[name='salutation']").bind("focusout", function(){ 55 var salutation = $("select[name='salutation']"); 56 validateReqDropdown(salutation); 57 }); 58 59 $("input[name='first_name']").bind("focusout", function(){ 60 var first_name_field = $("input[name='first_name']"); 61 validateNameField(first_name_field); 62 63 }); 64 65 $("input[name='last_name']").bind("focusout", function(){ 66 var last_name_field = $("input[name='last_name']"); 67 validateNameField(last_name_field); 68 }); 69 70 $("input[name='company']").bind("focusout", function(){ 71 var company_field = $("input[name='company']"); 72 validateField(company_field); 73 }); 74 75 $("input[name='title']").bind("focusout", function(){ 76 var job_title = $("input[name='title']"); 77 validateField(job_title); 78 }); 79 80 $("select[name='00N3000000BZGjt']").bind("focusout", function(){ 81 var what_can_we_help = $("select[name='00N3000000BZGjt']"); 82 validateDropdown(what_can_we_help); 83 }); 84 85 $("select[name='What_can_we_help_you_with__c']").bind("focusout", function(){ 86 var what_can_we_help = $("select[name='What_can_we_help_you_with__c']"); 87 validateDropdown(what_can_we_help); 88 }); 89 90 $("select[name='00N3000000BZGk3']").bind("focusout", function(){ 91 var area_of_interest = $("select[name='00N3000000BZGk3']"); 92 validateDropdown(area_of_interest); 93 }); 94 95 $("select[name='Area_of_Interest__c']").bind("focusout", function(){ 96 var area_of_interest = $("select[name='Area_of_Interest__c']"); 97 validateDropdown(area_of_interest); 98 }); 99 100 /*added a click event listener for real time PA validation - Gad*/ 101 $("select[name='00N3000000BZgbg']").bind("focusout click", function(){ 102 var practice_area = $("select[name='00N3000000BZgbg']"); 103 104 /* DO NOT DELETE */ 105 /* This is to apply to all free trial forms - JD */ 106 107 var productname = $("input[name='00N3000000BZGYj']").val(); 108 109 if ((productname == "LexisPSL" || productname == "LexisLibrary" || productname == "LexisLibrary - Halsburys Trial" || productname == "LexisLibrary Jordan Publishing") && $('form').hasClass('freetrial') ) { 110 validatePADropdown(practice_area); 111 } 112 else { 113 validateDropdown(practice_area); 114 } 115 116 }); 117 118 $("select[name='Practice_Area_APIL__c']").bind("focusout click", function(){ 119 var practice_area = $("select[name='Practice_Area_APIL__c']"); 120 121 /* DO NOT DELETE */ 122 /* This is to apply to all free trial forms - JD */ 123 124 var productname = $("input[name='Product_you_are__c']").val(); 125 126 if ((productname == "LexisPSL" || productname == "LexisLibrary" || productname == "LexisLibrary - Halsburys Trial" || productname == "LexisLibrary Jordan Publishing") && $('form').hasClass('freetrial') ) { 127 validatePADropdown(practice_area); 128 } 129 else { 130 validateDropdown(practice_area); 131 } 132 133 }); 134 135 $("input#phone").bind("focusout", function(){ 136 var phone_field = $("input#phone"); 137 validatePhone(phone_field); 138 }); 139 140 //PRJ-202308-0256: Form update for Zoominfo implementation 141 $("input#ZIphone").bind("focusout", function(){ 142 var phone_field = $("input#ZIphone"); 143 validateField(phone_field); 144 }); 145 //End of PRJ-202308-0256 146 147 $("input[name='email']").bind("focusout", function(){ 148 var email_field = $("input[name='email']"); 149 validateEmailField(email_field); 150 }); 151 152 $("input[name='00N30000009PrYS']").bind("focusout", function(){ 153 var postcode_field = $("input[name='00N30000009PrYS']"); 154 validateField(postcode_field); 155 }); 156 157 $("input[name='Postcode__c']").bind("focusout", function(){ 158 var postcode_field = $("input[name='Postcode__c']"); 159 validateField(postcode_field); 160 }); 161 162 $("select[name='00N3000000BZj7M']").bind("focusout", function(){ 163 var country = $("select[name='00N3000000BZj7M']"); 164 validateReqDropdown(country); 165 }); 166 167 $("select[name='Country__c']").bind("focusout", function(){ 168 var country = $("select[name='Country__c']"); 169 validateReqDropdown(country); 170 }); 171 172 $("select[name='Practice_Area_APIL__c']").bind("focusout", function(){ 173 var country = $("select[name='Practice_Area_APIL__c']"); 174 validateReqDropdown(country); 175 }); 176 177 $("select[name='00N3000000BZGYj']").bind("focusout", function(){ 178 var product = $("select[name='00N3000000BZGYj']"); 179 validateDropdown(product); 180 }); 181 182 $("select[name='Product_you_are__c']").bind("focusout", function(){ 183 var product = $("select[name='Product_you_are__c']"); 184 validateDropdown(product); 185 }); 186 187 /*newest field validations as of 7/13/2018 - Gad*/ 188 $("input[name='00N30000007f5h1']").bind("focusout", function(){ 189 var specific_product = $("input[name='00N30000007f5h1']"); 190 validateField(specific_product); 191 }); 192 193 $("select[name='00N3A00000CDOzQ']").bind("focusout", function(){ 194 var channel = $("select[name='00N3A00000CDOzQ']"); 195 validateDropdown(channel); 196 }); 197 198 $("input[name='00N3A00000CDNCG']").bind("focusout", function(){ 199 var csa_email = $("input[name='00N3A00000CDNCG']"); 200 validateField(csa_email); 201 }); 202 203 $("input[name='00N3A00000CDNCQ']").bind("focusout", function(){ 204 var sr_number = $("input[name='00N3A00000CDNCQ']"); 205 validateField(sr_number); 206 }); 207 208 $("select[name='00N3A00000CDNC6']").bind("focusout", function(){ 209 var what_prompted = $("select[name='00N3A00000CDNC6']"); 210 validateDropdown(what_prompted); 211 }); 212 213 /*required field validation*/ 214 /*no numbers*/ 215 216 }); 217 218 /* Validation Code */ 219 220 function Validate(){ 221 222 var count = 0, check = false;
223 224 $('.req').each(function() { 225 226 /*if ($(this).attr('type') == 'checkbox' && $(this).prop('checked') == false) { 227 if (!$(this).closest('.inputWrapper').next().hasClass('errMsg') && $(this).prop('checked') == false) { 228 $(this).closest('.oneField').append('<div class="errMsg"><p>Please confirm checkbox.</p></div>'); 229 count++; 230 } 231 else if ($(this).closest('.inputWrapper').next().hasClass('errMsg') && $(this).prop('checked') == false) { 232 count++; 233 } 234 235 } 236 237 else if ($(this).attr('type') == 'checkbox' && $(this).prop('checked') == true) { 238 if ($(this).closest('.inputWrapper').next().hasClass('errMsg') && $(this).prop('checked') == true) { 239 $(this).closest('.inputWrapper').next().remove(); 240 } 241 }*/ 242 243 if ($(this).attr('type') == 'checkbox' && $(this).prop('checked') == false) { 244 245 $(this).addClass("err"); 246 /*$(this).parent('.form-group').addClass("form-err"); disabled because it is overlapping in the tickbox*/ 247 248 if (!$(this).next().next().hasClass('errMsg') && $(this).prop('checked') == false) { 249 $(this).parent('.form-group').append('<div class="errMsg"><p>Please confirm checkbox.</p></div>'); 250 count++; 251 } else if ($(this).next().next().hasClass('errMsg') && $(this).prop('checked') == false) { 252 count++; 253 } 254 255 } 256 257 else if ($(this).attr('type') == 'checkbox' && $(this).prop('checked') == true) { 258 if ($(this).next().next().hasClass('errMsg') && $(this).prop('checked') == true) { 259 $(this).removeClass("err"); 260 $(this).parent('.form-group').removeClass("form-err"); 261 $(this).addClass("pass"); 262 $(this).next().next().remove(); 263 } 264 } 265 266 else if ($(this).val().length == 0 || $(this).val() == "None") { 267 268 $(this).removeClass("pass"); 269 $(this).parent('.form-group').removeClass("form-pass"); 270 $(this).addClass("err"); 271 $(this).parent('.form-group').addClass("form-err"); 272 $(this).parent('.form-group').find("label").addClass("ic-err"); 273 274 if (!$(this).next().hasClass('errMsg')) { 275 $(this).parent('.form-group').append('<div class="errMsg"><p>This field is required.</p></div>'); 276 } 277 count++; 278 } 279 280 else if ($(this).val() != "None" && $(this).attr('id') == 'salutation') { 281 $(this).removeClass("err"); 282 $(this).parent('.form-group').removeClass("form-err"); 283 $(this).parent('.form-group').addClass("form-pass"); 284 $(this).addClass("pass"); 285 $(this).next().remove(); 286 $(this).parent('.form-group').find("label").removeClass("ic-err"); 287 $(this).parent('.form-group').find("label").addClass("ic-pass"); 288 289 } 290 291 else if (($(this).val() != "None" && $(this).attr('id') == '00N3000000BZj7M') || ($(this).val() != "None" && $(this).attr('id') == 'Country__c')) { 292 $(this).removeClass("err"); 293 $(this).parent('.form-group').removeClass("form-err"); 294 $(this).parent('.form-group').addClass("form-pass"); 295 $(this).addClass("pass"); 296 if ($(this).val() == "United States of America" && $('form').hasClass('freetrial')) { 297 console.log("true"); 298 if ($(this).next().hasClass('errMsg')) { 299 $(this).next().find('p').html('Looking for US legislation, case law and practical guidance? <a href="https://www.lexisnexis.com/en-us/products/lexis-advance.page" target="_blank">Please click here.</a>'); 300 } else if (!$(this).next().hasClass('errMsg')) { 301 $(this).parent('.form-group').append('<div class="errMsg"><p>Looking for US legislation, case law and practical guidance? <a href="https://www.lexisnexis.com/en-us/products/lexis-advance.page" target="_blank">Please click here.</a></p></div>'); 302 } 303 $(this).next('.errMsg').css("color", "#0c5fca"); 304 $(this).next('.errMsg').css("background-color", "#cce5ff"); 305 } 306 else { 307 console.log("false"); 308 $(this).next().remove(); 309 } 310 $(this).parent('.form-group').find("label").removeClass("ic-err"); 311 $(this).parent('.form-group').find("label").addClass("ic-pass"); 312 313 } 314 315 316 317 else if ($(this).val() != "None" && $(this).attr('id') == '00N3000000BZGYj') { 318 $(this).removeClass("err"); 319 $(this).parent('.form-group').removeClass("form-err"); 320 $(this).parent('.form-group').addClass("form-pass"); 321 $(this).addClass("pass"); 322 $(this).next().remove(); 323 $(this).parent('.form-group').find("label").removeClass("ic-err"); 324 $(this).parent('.form-group').find("label").addClass("ic-pass"); 325 326 } 327 328 else if ($(this).val().length != 0 && $(this).attr('id') == 'company') { 329 $(this).removeClass("err"); 330 $(this).parent('.form-group').removeClass("form-err"); 331 $(this).parent('.form-group').addClass("form-pass"); 332 $(this).addClass("pass"); 333 $(this).next().remove(); 334 $(this).parent('.form-group').find("label").removeClass("ic-err"); 335 $(this).parent('.form-group').find("label").addClass("ic-pass"); 336 337 } 338 339 else if ($(this).val().length != 0 && $(this).attr('id') == 'title') { 340 $(this).removeClass("err"); 341 $(this).parent('.form-group').removeClass("form-err"); 342 $(this).parent('.form-group').addClass("form-pass"); 343 $(this).addClass("pass"); 344 $(this).next().remove(); 345 $(this).parent('.form-group').find("label").removeClass("ic-err"); 346 $(this).parent('.form-group').find("label").addClass("ic-pass"); 347 } 348 349 else if ($(this).val().length != 0 && $(this).attr('id') == 'email') { 350 if(!checkEmail($(this).val(), $(this))) { 351 count++; 352 } 353 } 354 355 else if ($(this).val().length != 0 && $(this).attr('id') == 'phone') { 356 357 if ($(this).next().hasClass('errMsg') && $(this).val().length <= 5 && !$.isNumeric($(this).val())) { 358 $(this).next().find('p').html('Numbers only.'); 359 count++; 360 } else if ($(this).next().hasClass('errMsg') && $(this).val().length <= 5 && $.isNumeric($(this).val())) { 361 $(this).next().find('p').html('Phone number is too short.'); 362 count++; 363 } else if (!$(this).next().hasClass('errMsg') && $(this).val().length <= 5 && $.isNumeric($(this).val())) { 364 $(this).parent('.form-group').append('<div class="errMsg"><p>Phone number is too short.</p></div>'); 365 count++; 366 } else if (!$(this).next().hasClass('errMsg') && $(this).val().length <= 5 && !$.isNumeric($(this).val())) { 367 $(this).parent('.form-group').append('<div class="errMsg"><p>Numbers only</p></div>'); 368 count++; 369 } else if (!$(this).next().hasClass('errMsg') && $(this).val().length <= 5 && !$.isNumeric($(this).val())) { 370 $(this).parent('.form-group').append('<div class="errMsg"><p>Numbers only</p></div>'); 371 count++; 372 } else if (!$(this).next().hasClass('errMsg') && $(this).val().length > 5 && !$.isNumeric($(this).val())) { 373 $(this).parent('.form-group').append('<div class="errMsg"><p>Numbers only</p></div>'); 374 count++; 375 } else if ($(this).next().hasClass('errMsg') && $(this).val().length > 5 && !$.isNumeric($(this).val())) { 376 $(this).next().find('p').html('Numbers only'); 377 count++; 378 } else if ($(this).next().hasClass('errMsg') && $(this).val().length > 5 && $.isNumeric($(this).val())) { 379 $(this).removeClass("err"); 380 $(this).parent('.form-group').removeClass("form-err"); 381 $(this).parent('.form-group').addClass("form-pass"); 382 $(this).addClass("pass"); 383 $(this).next().remove(); 384 } 385 } 386 387 else if ($(this).val().length != 0 && $(this).hasClass('postal')) { 388 $(this).removeClass("err"); 389 $(this).parent('.form-group').removeClass("form-err"); 390 $(this).parent('.form-group').addClass("form-pass"); 391 $(this).addClass("pass"); 392 $(this).next().remove(); 393 $(this).parent('.form-group').find("label").removeClass("ic-err"); 394 $(this).parent('.form-group').find("label").addClass("ic-pass"); 395 } 396 397 if ($(this).type =='checkbox') { 398 check == true; 399 } 400 401 }); 402 403 $('.req').each(function() { 404 if ($(this).val().length == 0 || $(this).val() == "None") { 405 $(this).focus(); 406 return false;
407 } else if (($(this).val().length != 0 || $(this).val() != "None") && $(this).next().hasClass('errMsg') && $(this).hasClass('err') ) { 408 $(this).focus(); 409 return false; 410 } 411 }); 412 413 if (!check) { 414 if (count !== 0) { 415 console.error(`[Form Submission Error]: The form is incomplete and has not been submitted. Your submission contains ${count} issue(s).`); 416 return false; 417 } else { 418 return true; 419 } 420 } 421 } 422 423 function validateEmailField(input_field){ 424 425 if(input_field.val().length == 0) { 426 427 input_field.removeClass("pass"); 428 input_field.addClass("err"); 429 input_field.parent('.form-group').removeClass("form-pass"); 430 input_field.parent('.form-group').addClass("form-err"); 431 input_field.parent('.form-group').find('label').removeClass('ic-pass'); 432 input_field.parent('.form-group').find('label').addClass('ic-err'); 433 434 if (!input_field.next().hasClass('errMsg')) { 435 input_field.parent('.form-group').append('<div class="errMsg"><p>This field is required.</p></div>'); 436 } 437 438 else if(input_field.next().hasClass('errMsg')) { 439 input_field.next().find('p').html('This field is required.'); 440 } 441 442 input_field.next('.errMsg').css("color", ""); 443 444 } 445 446 else { 447 checkEmail(input_field.val(), input_field); 448 } 449 } 450 451 452 function checkEmail(str, input_field) { 453 var re = /^(?=.{1,254}$)(?=.{1,64}@)[A-Za-z0-9!#$%&'*+/=?^_`{|}~.-]+@(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+[A-Za-z]{2,}$/; 454 var public_email = /^[A-Za-z0-9._%+-]+@(gmail.com|hotmail.com|hotmail.co.uk|yahoo.com|yahoo.co.uk|outlook.com|btinternet.com|aol.com|live.co.uk|icloud.com|googlemail.com|me.com|sky.com|live.com|msn.com|ymail.com|btconnect.com|qq.com|aol.co.uk|ntlworld.com|mail.com|mac.com|mail.ru|linklaters.com|btopenworld.com|talktalk.net|mailinator.com|mvrht.net|gmx.com|)$/; 455 if (re.test(str)) { 456 457 if(public_email.test(str)) { 458 if (input_field.next().hasClass('errMsg')) { 459 input_field.next().find('p').html('It looks like you may have used a personal email address. Please ensure the email you have entered is the one you use for work.'); 460 } else if (!input_field.next().hasClass('errMsg')) { 461 input_field.parent('.form-group').append('<div class="errMsg"><p>It looks like you may have used a personal email address. Please ensure the email you have entered is the one you use for work.</p></div>'); 462 } 463 input_field.removeClass("err"); 464 input_field.parent('.form-group').removeClass("form-err"); 465 input_field.parent('.form-group').addClass("form-pass"); 466 input_field.addClass("pass"); 467 input_field.next('.errMsg').css("color", "teal"); 468 input_field.parent('.form-group').find('label').removeClass('ic-err'); 469 input_field.parent('.form-group').find('label').addClass('ic-pass'); 470 return true; 471 } 472 473 else { 474 input_field.removeClass("err"); 475 input_field.parent('.form-group').removeClass("form-err"); 476 input_field.parent('.form-group').addClass("form-pass"); 477 input_field.addClass("pass"); 478 input_field.next().remove(); 479 input_field.parent('.form-group').find('label').removeClass('ic-err'); 480 input_field.parent('.form-group').find('label').addClass('ic-pass'); 481 return true; 482 } 483 484 } 485 486 else { 487 input_field.removeClass("pass"); 488 input_field.addClass("err"); 489 input_field.parent('.form-group').removeClass("form-pass"); 490 input_field.parent('.form-group').addClass("form-err"); 491 input_field.parent('.form-group').find('label').addClass('ic-err'); 492 493 if (input_field.next().hasClass('errMsg')) { 494 input_field.next().find('p').html('Your email address is invalid.'); 495 } else if (!input_field.next().hasClass('errMsg')) { 496 input_field.parent('.form-group').append('<div class="errMsg"><p>
496Your email address is invalid.</p></div>'); 497 } 498 499 input_field.next('.errMsg').css("color", ""); 500 return false; 501 } 502 } 503 504 function onlyAcceptNumberInput(i) { 505 var realnum = i.val().replace(/[^0-9+]/g, ''); 506 i.val(realnum); 507 } 508 509 function validateField(input_field){ 510 511 if(input_field.val().length == 0) { 512 513 input_field.removeClass("pass"); 514 input_field.addClass("err"); 515 input_field.parent('.form-group').removeClass("form-pass"); 516 input_field.parent('.form-group').addClass("form-err"); 517 input_field.parent('.form-group').find('label').removeClass('ic-pass'); 518 input_field.parent('.form-group').find('label').addClass('ic-err'); 519 520 if (!input_field.next().hasClass('errMsg')) { 521 input_field.parent('.form-group').append('<div class="errMsg"><p>This field is required.</p></div>'); 522 } 523 524 else if(input_field.next().hasClass('errMsg')) { 525 input_field.next().find('p').html('This field is required.'); 526 } 527 } 528 529 else { 530 input_field.removeClass("err"); 531 input_field.parent('.form-group').removeClass("form-err"); 532 input_field.parent('.form-group').addClass("form-pass"); 533 input_field.addClass("pass"); 534 input_field.next().remove(); 535 input_field.parent('.form-group').find('label').removeClass('ic-err'); 536 input_field.parent('.form-group').find('label').addClass('ic-pass'); 537 } 538 } 539 540 function validateJTField(input_field){ 541 542 if(input_field.val().length != 0) { 543 input_field.addClass("pass"); 544 input_field.parent('.form-group').addClass("form-pass"); 545 input_field.parent('.form-group').find('label').addClass('ic-pass'); 546 } 547 548 else { 549 input_field.removeClass("pass"); 550 input_field.parent('.form-group').removeClass("form-pass"); 551 input_field.parent('.form-group').find('label').removeClass('ic-pass'); 552 } 553 } 554 555 function validateDropdown(input_field){ 556 557 if(input_field.val() == "None") { 558 input_field.removeClass("pass"); 559 input_field.parent('.form-group').removeClass("form-pass"); 560 input_field.parent('.form-group').find('label').removeClass('ic-pass'); 561 } 562 563 else { 564 input_field.addClass("pass"); 565 input_field.parent('.form-group').addClass("form-pass"); 566 input_field.parent('.form-group').find('label').addClass('ic-pass'); 567 } 568 } 569 570 /*validation for PA dropdown if the product offered is LexisPSL - Gad*/ 571 function validatePADropdown(input_field){ 572 573 if(input_field.val() == "None") { 574 input_field.removeClass("pass"); 575 input_field.parent('.form-group').removeClass("form-pass"); 576 input_field.parent('.form-group').find('label').removeClass('ic-pass'); 577 if (input_field.next().hasClass('errMsg')) { 578 input_field.next().remove(); 579 } 580 581 if (input_field.parent('.form-group').hasClass('form-info')) { 582 input_field.parent('.form-group').removeClass("form-info"); 583 } 584 } 585 586 else if(input_field.val() == "Practice Management" || input_field.val() == "Practice Compliance" || input_field.val() == "Risk & Compliance"){ 587 console.log("Free trial is not available, click below and one of our sales team will get in touch with you to setup a demo for this practice area."); 588 if (!input_field.next().hasClass('errMsg')) { 589 input_field.parent('.form-group').append('<div class="errMsg"><p>Sorry, we do not offer a free trial for this practice area but please click the red button below and we will call you to arrange a demo.</p></div>'); 590 } 591 592 else if(input_field.next().hasClass('errMsg')) { 593 input_field.next().find('p').html('Sorry, we do not offer a free trial for this practice area but please click the red button below and we will call you to arrange a demo.'); 594 } 595 /*added a blue background color for PA information - Gad*/ 596 input_field.next('.errMsg').css("color", "#0c5fca"); 597 input_field.next('.errMsg').css("background-color", "#cce5ff"); 598 input_field.parent('.form-group').addClass("form-info"); 599 600 } 601 602 else { 603 input_field.parent('.form-group').removeClass("form-info"); 604 input_field.addClass("pass"); 605 input_field.parent('.form-group').addClass("form-pass"); 606 input_field.parent('.form-group').find('label').addClass('ic-pass'); 607 input_field.next().remove(); 608 } 609 } 610 611 function validateNameField(input_field) { 612 613 if(input_field.val().length == 0) { 614 615 input_field.removeClass("pass"); 616 input_field.addClass("err"); 617 input_field.parent('.form-group').removeClass("form-pass"); 618 input_field.parent('.form-group').addClass("form-err"); 619 input_field.parent('.form-group').find('label').removeClass('ic-pass'); 620 input_field.parent('.form-group').find('label').addClass('ic-err'); 621 622 if (!input_field.next().hasClass('errMsg')) { 623 input_field.parent('.form-group').append('<div class="errMsg"><p>This field is required.</p></div>'); 624 } 625 626 else if(input_field.next().hasClass('errMsg')) { 627 input_field.next().find('p').html('This field is required.'); 628 } 629 } 630 631 else { 632 checkNumberInput(input_field); 633 } 634 635 } 636 637 function checkNumberInput(input_field){ 638 // if (!input_field.next().hasClass('errMsg') && !/^[a-zA-Z() ]+$/.test(input_field.val())) { 639 // input_field.parent('.form-group').append('<div class="errMsg"><p>Please do not enter numbers.</p></div>'); 640 // } 641 642 // else if (input_field.next().hasClass('errMsg') && !/^[a-zA-Z() ]+$/.test(input_field.val())) { 643 // input_field.next().find('p').html('Please do not enter numbers.'); 644 // } 645 646 // else if (input_field.next().hasClass('errMsg') && /^[a-zA-Z() ]+$/.test(input_field.val())) { 647 // input_field.removeClass("err"); 648 // input_field.addClass("pass"); 649 // input_field.next().remove(); 650 // } 651 652 if (/[0-9]/.test(input_field.val())) { 653 654 input_field.removeClass("pass"); 655 input_field.addClass("err"); 656 input_field.parent('.form-group').removeClass("form-pass"); 657 input_field.parent('.form-group').addClass("form-err"); 658 input_field.parent('.form-group').find('label').addClass('ic-err'); 659 660 if (!input_field.next().hasClass('errMsg')) { 661 input_field.parent('.form-group').append('<div class="errMsg"><p>Please do not enter numbers.</p></div>'); 662 } 663 664 else if(input_field.next().hasClass('errMsg')) { 665 input_field.next().find('p').html('Please do not enter numbers.'); 666 } 667 } 668 669 else { 670 input_field.removeClass("err"); 671 input_field.parent('.form-group').removeClass("form-err"); 672 input_field.parent('.form-group').addClass("form-pass"); 673 input_field.addClass("pass"); 674 input_field.next().remove(); 675 input_field.parent('.form-group').find('label').removeClass('ic-err'); 676 input_field.parent('.form-group').find('label').addClass('ic-pass'); 677 } 678 } 679 680
681 function validateReqDropdown(select_field) { 682 683 if(select_field.val() == "None") { 684 select_field.removeClass("pass"); 685 select_field.addClass("err"); 686 select_field.parent('.form-group').removeClass("form-pass"); 687 select_field.parent('.form-group').addClass("form-err"); 688 select_field.parent('.form-group').find('label').removeClass('ic-pass'); 689 select_field.parent('.form-group').find('label').addClass('ic-err'); 690 691 if (!select_field.next().hasClass('errMsg')) { 692 select_field.parent('.form-group').append('<div class="errMsg"><p>This field is required.</p></div>'); 693 } 694 695 else if(select_field.next().hasClass('errMsg')) { 696 select_field.next().find('p').html('This field is required.'); 697 } 698 699 select_field.next('.errMsg').css("color", ""); 700 select_field.next('.errMsg').css("background-color", ""); 701 } 702 703 else { 704 select_field.removeClass("err"); 705 select_field.parent('.form-group').removeClass("form-err"); 706 select_field.addClass("pass"); 707 select_field.parent('.form-group').addClass("form-pass"); 708 if (select_field[0] == $("select[name='00N3000000BZj7M']")[0] && $('form').hasClass('freetrial') ) { 709 if (select_field.val() == "United States of America") { 710 console.log("true-rt"); 711 if (select_field.next().hasClass('errMsg')) { 712 select_field.next().find('p').html('Looking for US legislation, case law and practical guidance? <a href="https://www.lexisnexis.com/en-us/products/lexis-advance.page" target="_blank">Please click here.</a>'); 713 } else if (!select_field.next().hasClass('errMsg')) { 714 select_field.parent('.form-group').append('<div class="errMsg"><p>Looking for US legislation, case law and practical guidance? <a href="https://www.lexisnexis.com/en-us/products/lexis-advance.page" target="_blank">Please click here.</a></p></div>'); 715 } 716 select_field.next('.errMsg').css("color", "#0c5fca"); 717 select_field.next('.errMsg').css("background-color", "#cce5ff"); 718 } 719 else { 720 console.log("false-rt"); 721 select_field.next().remove(); 722 } 723 } 724 else { 725 console.log("false-rt"); 726 select_field.next().remove(); 727 } 728 select_field.parent('.form-group').find('label').removeClass('ic-err'); 729 select_field.parent('.form-group').find('label').addClass('ic-pass'); 730 } 731 732 } 733 734 735 function validatePhone(input_field) { 736 if(input_field.val().length == 0) { 737 738 input_field.removeClass("pass"); 739 input_field.addClass("err"); 740 input_field.parent('.form-group').removeClass("form-pass"); 741 input_field.parent('.form-group').addClass("form-err"); 742 input_field.parent('.form-group').find('label').removeClass('ic-pass'); 743 input_field.parent('.form-group').find('label').addClass('ic-err'); 744 745 if (!input_field.next().hasClass('errMsg')) { 746 input_field.parent('.form-group').append('<div class="errMsg"><p>This field is required.</p></div>'); 747 } 748 749 else if(input_field.next().hasClass('errMsg')) { 750 input_field.next().find('p').html('This field is required.'); 751 } 752 } 753 754 else if(input_field.val().length <= 5) { 755 input_field.removeClass("pass"); 756 input_field.addClass("err"); 757 input_field.parent('.form-group').removeClass("form-pass"); 758 input_field.parent('.form-group').addClass("form-err"); 759 input_field.parent('.form-group').find('label').removeClass('ic-pass'); 760 input_field.parent('.form-group').find('label').addClass('ic-err'); 761 762 if (!input_field.next().hasClass('errMsg')) { 763 input_field.parent('.form-group').append('<div class="errMsg"><p>Phone number is too short.</p></div>'); 764 } 765 766 else if(input_field.next().hasClass('errMsg')) { 767 input_field.next().find('p').html('Phone number is too short.'); 768 } 769 } 770 771 else { 772 input_field.removeClass("err"); 773 input_field.parent('.form-group').removeClass("form-err"); 774 input_field.parent('.form-group').addClass("form-pass"); 775 input_field.addClass("pass"); 776 input_field.next().remove(); 777 input_field.parent('.form-group').find('label').removeClass('ic-err'); 778 input_field.parent('.form-group').find('label').addClass('ic-pass'); 779 } 780 } 781 782 function removeNumber(input_field) { 783 var letter = input_field.val().replace(/[^a-zA-Z]/g, ''); 784 input_field.val(letter); 785 }
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.