1(function () { 2 'use strict'; 3 window.addEventListener('load', function () { 4 console.log('window.addEventListener load!'); 5 // Fetch all the forms we want to apply custom Bootstrap validation styles to 6 var forms = document.getElementsByClassName('needs-validation'); 7 // Loop over them and prevent submission 8 var validation = Array.prototype.filter.call(forms, function (form) { 9 form.addEventListener('submit', function (event) { 10 if (form.checkValidity() === false) { 11 event.preventDefault(); 12 event.stopPropagation(); 13 } 14 form.classList.add('was-validated'); 15 16 }, false); 17 }); 18 }, false); 19})(); 20 21function getMultiplyBaseUrl() { 22 const hostname = window.location.hostname; 23 24 if (hostname.includes("wwdev")) { 25 return "https://wwdev.multiply.co.za"; 26 } 27 28 if (hostname.includes("wwpre")) { 29 return "https://wwpre.multiply.co.za"; 30 } 31 32 if (hostname.includes("www")) { 33 return "https://www.multiply.co.za"; 34 } 35 36 // Default/fallback 37 return "https://wwdev.multiply.co.za"; 38} 39 40const MULTIPLY_BASE_URL = getMultiplyBaseUrl(); 41 42 function trackFormClick(buttonId) { 43 console.log("trackFormClick called", buttonId); 44 const button = document.getElementById(buttonId); 45 46 if (!button) return; 47 48 const rawText = getElementText(button); 49 const pageSection = getPageSection(); 50 51 window.dataLayer.push({ 52 event: "click", 53 scheme: scheme || "https", 54 click_type: "form_submit", 55 page_section: pageSection || "unknown", 56 button_id: slugify(rawText), 57 cta_text: rawText || "unknown", 58 cta_url: "no_url", 59 page_path: window.location.pathname || "unknown", 60 page_full_url: window.location.href || "unknown" 61 }); 62 } 63 64$(document).ready(function () { 65 66 console.log('ready()!'); 67 initialiseIndex(); 68 initialiseEligibilitySuccess(); 69 initialisePersonalInformation(); 70 initialiseContactInformation(); 71 72 $("#backButton").click(function () { 73 console.log('backButton!'); 74 window.history.back(); 75 }); 76 77 function doBirthDateIdNumberFieldValidation() { 78 console.log('doBirthDateIdNumberFieldValidation!'); 79 if (!$("#titleInput").val()) { 80 $("#titleInvalidFeedback").show(); 81 } 82 if (!$("#dateOfBirthInput").val()) { 83 $("#invalidDateOfBirthMessage").html("Date of birth is required."); 84 $("#dateOfBirthInvalidFeedback").show(); 85 } else if ($("#dateOfBirthInput").val() && !validateDateOfBirthAgainstIdNumber($("#dateOfBirthInput").val(), $("#idNumberInput").val())) { 86 $("#invalidDateOfBirthMessage").html("The date of birth does not match with provided ID number."); 87 $("#dateOfBirthInvalidFeedback").show(); 88 } 89 90 } 91 //------------ index ---------// 92 var identityType = "ID"; 93 94 function initialiseIndex() { 95 console.log('initialiseIndex!'); 96 $(".passportContainerDiv").hide(); 97 $('#idNumberRadio').prop('checked', true); 98 $("#eligibilityCheckButtonLoading").hide(); 99 100 } 101 102 function selectSAId() { 103 console.log('selectSAId!'); 104 identityType = "ID"; 105 106 $(".idContainerDiv").show(); 107 $(".passportContainerDiv").hide(); 108 109 $("#idNumberInput").prop('required', true); 110 111 $("#passportInput").prop('required', false); 112 $("#nameInput").prop('required', false); 113 $("#lastNameInput").prop('required', false); 114 $("#initialInput").prop('required', false); 115 $("#dateOfBirthInput").prop('required', false); 116 } 117 118 function selectPassport() { 119 console.log('selectPassport on submit!'); 120 identityType = "PASSPORT"; 121 122 $(".idContainerDiv").hide(); 123 $(".passportContainerDiv").show(); 124 125 $("#idNumberInput").prop('required', false); 126 127 $("#passportInput").prop('required', true); 128 $("#nameInput").prop('required', true); 129 $("#lastNameInput").prop('required', true); 130 $("#initialInput").prop('required', true); 131 $("#dateOfBirthInput").prop('required', true); 132 } 133 134 $("input[type='radio']").change(function () { 135 console.log('input[type=radio] on change!'); 136 let identityType = $(this).val(); 137 138 switch (identityType) { 139 case "ID": 140 selectSAId(); 141 break; 142 case "PASSPORT": 143 selectPassport(); 144 break; 145 } 146 });
147 148 // Eligibility Check Form Submission 149 // Eligibility Check Form Submission 150$("#eligibilityCheckForm").on("submit", function (e) { 151 152 e.preventDefault(); 153 e.stopPropagation(); 154 155 console.log("eligibilityCheckForm on submit!"); 156 157 // ----------------------------------------- 158 // Bootstrap validation 159 // ----------------------------------------- 160 if (this.checkValidity() === false) { 161 162 if (!$("#dateOfBirthInput").val()) { 163 $("#invalidDateOfBirthMessage") 164 .html("Date of birth is required."); 165 166 $("#dateOfBirthInvalidFeedback").show(); 167 } 168 169 $("#eligibilityCheckButton").show(); 170 $("#eligibilityCheckButtonLoading").hide(); 171 172 return; 173 } 174 175 // ----------------------------------------- 176 // Validate SA ID 177 // ----------------------------------------- 178 if ( 179 identityType === "ID" && 180 !validateIdNumber($("#idNumberInput").val()) 181 ) { 182 183 $("#eligibilityCheckButton").show(); 184 $("#eligibilityCheckButtonLoading").hide(); 185 186 return; 187 } 188 189 // ----------------------------------------- 190 // CHECK reCAPTCHA 191 // ----------------------------------------- 192 const captchaResponse = grecaptcha.getResponse(); 193 194 if (!captchaResponse || captchaResponse.length === 0) { 195 196 console.log("Please complete the reCAPTCHA."); 197 198 // Optional message 199 $("#recaptchaError").show(); 200 201 $("#eligibilityCheckButton").show(); 202 $("#eligibilityCheckButtonLoading").hide(); 203 204 return; 205 } 206 207 // ----------------------------------------- 208 // reCAPTCHA is valid 209 // ----------------------------------------- 210 211 console.log("reCAPTCHA completed."); 212 213 // Track ONLY after all validation has passed 214 trackFormClick("eligibilityCheckButton"); 215 216 // Disable button / show loading 217 $("#eligibilityCheckButton") 218 .prop("disabled", true) 219 .hide(); 220 221 $("#eligibilityCheckButtonLoading").show(); 222 223 // Store the token 224 sessionStorage.setItem( 225 "captchaToken", 226 captchaResponse 227 ); 228 229 const captchaResponseStored = 230 sessionStorage.getItem("captchaToken"); 231 232 // ----------------------------------------- 233 // Build request body 234 // ----------------------------------------- 235 let requestBody = {}; 236 237 if (identityType === "ID") { 238 239 requestBody = { 240 identityType: "ID", 241 idNumber: $("#idNumberInput").val() 242 }; 243 244 } else { 245 246 requestBody = { 247 identityType: "PASSPORT", 248 passportNumber: $("#passportInput").val(), 249 passportCountryOfIssue: $("#passportCountryOfIssue").val() 250 }; 251 } 252 253 // ----------------------------------------- 254 // Eligibility API Call 255 // ----------------------------------------- 256 $.ajax({
257 258 url: 259 MULTIPLY_BASE_URL + "/engaged/api/eligibility/check?g-recaptcha-response=" 260 + encodeURIComponent(captchaResponseStored), 261 262 type: "POST", 263 264 contentType: "application/json", 265 266 data: JSON.stringify(requestBody), 267 268 xhrFields: { 269 withCredentials: true 270 }, 271 272 success: function (response, status, xhr) { 273 274 console.log("ELIGIBILITY SUCCESS", response); 275 276 $("#eligibilityCheckButtonLoading").hide(); 277 278 // Store session ID 279 if (response && response.sessionId) { 280 sessionStorage.setItem( 281 "sessionId", 282 response.sessionId 283 ); 284 } 285 286 // Store auth token 287 const authToken = 288 xhr.getResponseHeader("Authorization"); 289 290 if (authToken) { 291 sessionStorage.setItem( 292 "authToken", 293 authToken 294 ); 295 } 296 297 // Store response 298 sessionStorage.setItem( 299 "eligibilityResponse", 300 JSON.stringify(response) 301 ); 302 303 // ----------------------------------------- 304 // Eligible -> Request OTP 305 // ----------------------------------------- 306 if (response && response.eligible === true) { 307 308 const idNumber = 309 $("#idNumberInput").val(); 310 311 sessionStorage.setItem( 312 "idNumber", 313 idNumber 314 ); 315 316 $.ajax({
317 318 url: 319 MULTIPLY_BASE_URL + "/engaged/api/otp/request?g-recaptcha-response=" 320 + encodeURIComponent(captchaResponseStored), 321 322 type: "POST", 323 324 contentType: "application/json", 325 326 data: JSON.stringify({ 327 idNumber: idNumber, 328 category: "MEMBERSHIP_CHANGES", 329 subCategory: "PLAN_UPGRADE" 330 }), 331 332 xhrFields: { 333 withCredentials: true 334 }, 335 336 success: function (otpResponse) { 337 338 console.log( 339 "OTP REQUEST SUCCESS", 340 otpResponse 341 ); 342 343 window.location.href = 344 "/otpcheck"; 345 }, 346 347 error: function (error) { 348 349 console.log( 350 "OTP REQUEST ERROR", 351 error 352 ); 353 354 $("#eligibilityCheckButton") 355 .prop("disabled", false) 356 .show(); 357 358 $("#eligibilityCheckButtonLoading") 359 .hide(); 360 361 grecaptcha.reset(); 362 363 console.log( 364 "Unable to request OTP. Please try again." 365 ); 366 } 367 }); 368 369 } else { 370 371 // ----------------------------------------- 372 // Not eligible 373 // ----------------------------------------- 374 375 if ( 376 response.currentPlan === 377 "MULTIPLYENGAGEPLUS" 378 ) { 379 380 window.location.href = 381 "/engage-plus"; 382 383 } else if ( 384 response.currentPlan === 385 "MULTIPLYINSPIREPLUS" 386 ) { 387 388 window.location.href = 389 "/inspire-plus"; 390 391 } else { 392 393 window.location.href = 394 "/join-multiply"; 395 } 396 } 397 }, 398 399 error: function (error) { 400 401 console.log( 402 "ELIGIBILITY ERROR", 403 error 404 ); 405 406 grecaptcha.reset(); 407 408 $("#eligibilityCheckButton") 409 .prop("disabled", false) 410 .show(); 411 412 $("#eligibilityCheckButtonLoading") 413 .hide(); 414 415 console.log( 416 "Something went wrong. Please try again." 417 ); 418 } 419 }); 420}); 421 // End Eligibility Check 422 423 // ================================ 424 // OTP VALIDATION 425 // ================================ 426 427 $("#otpSubmitButtonLoading").hide(); 428 429 // ================================ 430 // OTP VALIDATION 431 // ================================ 432 433 $("#otpSubmitButtonLoading").hide(); 434 435 $("#otpForm").submit(function (e) { 436 437 e.preventDefault(); 438 e.stopPropagation(); 439 440 $("#otpSubmitButton").hide(); 441 $("#otpSubmitButtonLoading").show(); 442 443 const form = document.getElementById("otpForm"); 444 445 if (!form.checkValidity()) { 446 form.classList.add("was-validated"); 447 448 $("#otpSubmitButton").show(); 449 $("#otpSubmitButtonLoading").hide(); 450 451 return; 452 } 453 454 const otp = $("#otpInput").val(); 455 456 // Get stored captcha token 457 const captchaResponse = sessionStorage.getItem("captchaToken"); 458 459 if (!captchaResponse) { 460 461 console("Captcha token not found. Please start again."); 462 463 $("#otpSubmitButton").show(); 464 $("#otpSubmitButtonLoading").hide(); 465 466 return; 467 } 468 469 $.ajax({
470 471 url: MULTIPLY_BASE_URL + "/engaged/api/otp/validate?g-recaptcha-response=" + captchaResponse, 472 473 type: "POST", 474 475 contentType: "application/json", 476 477 data: JSON.stringify({ 478 otp: otp 479 }), 480 481 xhrFields: { 482 withCredentials: true 483 }, 484 485 success: function (response) { 486 487 488 console.log("OTP VALIDATION SUCCESS", response); 489 trackFormClick("otpSubmitButton"); 490 491 sessionStorage.setItem( 492 "otpValidationResponse", 493 JSON.stringify(response) 494 ); 495 496 window.location.href = "/eligibility/submit-otp"; 497 }, 498 499 error: function (xhr) { 500 501 console.log("OTP VALIDATION ERROR", xhr); 502 503 $("#otpSubmitButton").show(); 504 $("#otpSubmitButtonLoading").hide(); 505 506 // Only reset reCAPTCHA if one exists on the page 507 if (typeof grecaptcha !== "undefined") { 508 try { 509 grecaptcha.reset(); 510 } catch (e) { } 511 } 512 513 if (xhr.responseJSON && xhr.responseJSON.message) { 514 console(xhr.responseJSON.message); 515 } else { 516 console("Invalid OTP. Please try again."); 517 } 518 } 519 520 }); 521 522 }); 523 524 525 526 //================================= 527 // Save to session only 528 //================================= 529 530 $("#bank").on("submit", function (e) { 531 e.preventDefault(); 532 533 const payload = { 534 accountHolder: $("#accountHolderInput").val(), 535 accountNumber: $("#accountNumberInput").val(), 536 accountTypeCode: $("#accountTypeSelect").val(), 537 bankName: $("#bankSelect").val(), 538 branchCode: $("#branchCodeInput").val(), 539 branchName: "", 540 paymentMethodDescription: "Debit Order", 541 deductionDay: $("#deductionDay").val() 542 }; 543 544 // Save for the next page 545 sessionStorage.setItem("upgradeRequest", JSON.stringify(payload)); 546 trackFormClick 547 // Navigate to confirmation page 548 window.location.href = "/eligibility/submit-confirm"; 549 }); 550 //================================= 551 // UPGRADE NOW -> BANKING FORM SUBMIT 552 //================================= 553 554 555 $("#upgradeNow").on("click", function (e) { 556 e.preventDefault(); 557 e.stopPropagation(); 558 559 const captchaResponse = sessionStorage.getItem("captchaToken"); 560 const payload = sessionStorage.getItem("upgradeRequest"); 561 562 if (!captchaResponse) { 563 console("Please complete the reCAPTCHA."); 564 return; 565 } 566 567 if (!payload) { 568 console("No upgrade request found."); 569 return; 570 } 571 572 $.ajax({
573 url: MULTIPLY_BASE_URL + "/engaged/api/contract/upgrade?g-recaptcha-response=" + encodeURIComponent(captchaResponse), 574 type: "POST", 575 contentType: "application/json", 576 data: payload, 577 578 success: function (response, textStatus, jqXHR) { 579 580 if (jqXHR.status === 200) { 581 sessionStorage.setItem("upgradeResponse", JSON.stringify(response)); 582 setTimeout(function () { 583 trackFormClick("upgradeNow"); 584 window.location.href = "/eligibility/upgraded"; 585 }, 500); 586 587 } else { 588 console("Unexpected response from the server."); 589 } 590 }, 591 592 error: function (xhr) { 593 console.error(xhr); 594 595 console("Unable to submit your banking details."); 596 } 597 }); 598 599 }); 600 601 // ================================ 602 // LEADS FORM SUBMIT 603 // ================================ 604 const captchaResponse = sessionStorage.getItem("captchaToken"); 605 606 $("#leadsForm").submit(function (e) { 607 608 e.preventDefault(); 609 610 // Validate form first 611 if (!validateLeadsForm()) { 612 return; 613 } 614 615 const payload = { 616 firstName: $("#firstName").val().trim(), 617 lastName: $("#lastName").val().trim(), 618 mobileNumber: $("#contactNumber").val().trim(), 619 emailAddress: $("#emailAddress").val().trim(), 620 idNumber: "1234567890", 621 passportNumber: "AB123456", 622 countryOfOrigin: "ZA" 623 }; 624 625 $.ajax({
626 627 url: MULTIPLY_BASE_URL + "/engaged/api/leads/request?g-recaptcha-response=" + encodeURIComponent(captchaResponse), 628 629 type: "POST", 630 631 contentType: "application/json", 632 633 data: JSON.stringify(payload), 634 635 xhrFields: { 636 withCredentials: true 637 }, 638 639 success: function () { 640 641 sessionStorage.setItem("firstName", payload.firstName); 642 643 trackFormClick("submitForm"); 644 645 window.location.href = "/join-multiply/leads-success"; 646 }, 647 648 error: function (xhr, status, error) { 649 650 console.log("Something went wrong", error); 651 652 window.location.href = "/join-multiply/leads-fail"; 653 } 654 655 }); 656 657}); 658 659 660function validateLeadsForm() { 661 662 let isValid = true; 663 664 // Reset validation 665 $(".invalid-feedback").hide(); 666 $(".form-control").removeClass("is-invalid"); 667 668 // First Name 669 if ($("#firstName").val().trim() === "") { 670 $("#firstName") 671 .addClass("is-invalid") 672 .siblings(".emptyInput") 673 .show(); 674 675 isValid = false; 676 } 677 678 // Last Name 679 if ($("#lastName").val().trim() === "") { 680 $("#lastName") 681 .addClass("is-invalid") 682 .siblings(".emptyInput") 683 .show(); 684 685 isValid = false; 686 } 687 688 // Contact Number 689 const contactNumber = $("#contactNumber").val().trim(); 690 const phoneRegex = /^[0-9]{10}$/; // SA numbers 691 692 if (contactNumber === "") { 693 694 $("#contactNumber").addClass("is-invalid"); 695 $("#callMeDiv .emptyInput").show(); 696 isValid = false; 697 698 } else if (!phoneRegex.test(contactNumber)) { 699 700 $("#contactNumber").addClass("is-invalid"); 701 $("#callMeDiv .invalidInput").show(); 702 isValid = false; 703 } 704 705 // Email 706 const email = $("#emailAddress").val().trim(); 707 const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; 708 709 if (email === "") { 710 711 $("#emailAddress").addClass("is-invalid"); 712 $("#emailMeDiv .emptyInput").show(); 713 isValid = false; 714 715 } else if (!emailRegex.test(email)) { 716 717 $("#emailAddress").addClass("is-invalid"); 718 $("#emailMeDiv .invalidInput").show(); 719 isValid = false; 720 } 721 722 return isValid; 723} 724 725// Allow numbers only in contact number 726$("#contactNumber").on("input", function () { 727 this.value = this.value.replace(/\D/g, ""); 728}); 729 730// Clear validation when typing 731$(".form-control").on("input", function () { 732 $(this).removeClass("is-invalid"); 733 $(this).siblings(".invalid-feedback").hide(); 734}); 735 736 $("#idNumberInput").keyup(function () { 737 console.log('idNumberInput on keyup!'); 738 739 var value = $(this).val(); 740 if (!validateIdNumber(value)) { 741 $("#invalidIdFeedBack").show(); 742 } else { 743 $("#invalidIdFeedBack").hide(); 744 } 745 746 }); 747 748 //------------ eligibility success ---------// 749 function initialiseEligibilitySuccess() { 750 console.log('initialiseEligibilitySuccess!'); 751 $('#startDateToday').prop('checked', true); 752 } 753 754 //------------ personal information ---------// 755 function initialisePersonalInformation() { 756 console.log('initialisePersonalInformation on submit!'); 757 $('#maleRadioInput').prop('checked', true); 758 } 759 760 $("#personalInformationForm").submit(function (e) { 761 console.log('personalInformationForm on submit!'); 762 763 if (this.checkValidity() === false) { 764 765 e.preventDefault(); 766 e.stopPropagation(); 767 768 doBirthDateIdNumberFieldValidation(); 769 } 770 771 }); 772 773 $('#titleInput').on('change', function () { 774 console.log('titleInput on change!'); 775 if (this.value) { 776 $("#titleInvalidFeedback").hide(); 777 } else { 778 $("#titleInvalidFeedback").show(); 779 } 780 }); 781 782 $('#dateOfBirthInput').on('change', function () { 783 console.log('dateOfBirthInput on change!'); 784 785 if (this.value) { 786 if ($("#idNumberInput").val() && !validateDateOfBirthAgainstIdNumber(this.value, $("#idNumberInput").val())) {
787 $("#invalidDateOfBirthMessage").html("The date of birth does not match with provided ID number."); 788 $("#dateOfBirthInvalidFeedback").show(); 789 } else { 790 $("#dateOfBirthInvalidFeedback").hide(); 791 } 792 } else { 793 $("#dateOfBirthInvalidFeedback").show(); 794 } 795 796 }); 797 798 //------------ contact information ---------// 799 function initialiseContactInformation() { 800 console.log('initialiseContactInformation!'); 801 $('#emailRadioOption').prop('checked', true); 802 $('#noRadioOption').prop('checked', true); 803 } 804 805 $("#cellphoneInput").focusout(function () { 806 console.log('cellphoneInput on focusout!'); 807 808 if (!validateCellphoneNumber($(this).val())) { 809 $(this).siblings(".invalid-feedback").show(); 810 } else { 811 $(this).siblings(".invalid-feedback").hide(); 812 } 813 814 }); 815 816 //------------ view members ---------// 817 $('.edit-member-link').on('click', function () { 818 console.log('.edit-member-link on click!'); 819 $("#editIndex").val($(this).attr('id')); 820 $("#confirmEditMemberModal").modal("show"); 821 }); 822 823 $(".delete-member-link").click(function () { 824 console.log('.delete-member-link on click!'); 825 $("#deleteIndex").val($(this).attr('id')); 826 $("#confirmDeleteMemberModal").modal("show"); 827 }); 828 829 //------------ add member ---------// 830 831 $("#isGuardianInputContainer").hide(); 832 833 $('#dateOfBirthInput').on('change', function () { 834 console.log('dateOfBirthInput on change!'); 835 836 let dependantAge = getAgeFromBirthDate(this.value); 837 838 if (dependantAge < 18) { 839 840 $("#isGuardianInputContainer").show(); 841 $("#isGuardianInput").prop('required', true); 842 843 if ($("#relationshipSelect").val() == 'PARTNER') { 844 $("#dateOfBirthForPartnerInvalidFeedback").show(); 845 } else { 846 $("#dateOfBirthForPartnerInvalidFeedback").hide(); 847 } 848 849 } else { 850 851 $("#isGuardianInputContainer").hide(); 852 $("#isGuardianInput").prop('required', false); 853 854 $("#dateOfBirthForPartnerInvalidFeedback").hide(); 855 856 } 857 858 }); 859 860 $("#addMemberForm").submit(function (e) { 861 console.log('addMemberForm on submit!'); 862 863 e.preventDefault(); 864 e.stopPropagation(); 865 866 if (this.checkValidity() === false) { 867 868 //Check consent here 869 doChildDependantConsentValidation(); 870 doBirthDateIdNumberFieldValidation(); 871 872 } else { 873 874 if (getAgeFromBirthDate($("#dateOfBirthInput").val()) < 18 && $("#relationshipSelect").val() == 'PARTNER') { 875 $("#dateOfBirthForPartnerInvalidFeedback").show(); 876 } else { 877 $("#dateOfBirthForPartnerInvalidFeedback").hide(); 878 this.submit(); 879 } 880 881 } 882 883 }); 884 885 $('#relationshipSelect').on('change', function () { 886 console.log('relationshipSelect on change!'); 887 888 if (this.value == "PARTNER") { 889 $("#emailInput").prop('required', true); 890 $("#cellphoneInput").prop('required', true); 891 } else { 892 $("#emailInput").prop('required', false); 893 $("#cellphoneInput").prop('required', false); 894 } 895 }); 896 897 $('#isGuardianInput').on('change', function () { 898 console.log('isGuardianInput on change!'); 899 if (this.checked) { 900 $("#consentInvalidFeedback").hide(); 901 } else { 902 $("#consentInvalidFeedback").show(); 903 } 904 }); 905 906 function doChildDependantConsentValidation() { 907 console.log('doChildDependantConsentValidation!'); 908 if (getAgeFromBirthDate($("#dateOfBirthInput").val()) < 18) { 909 $("#consentInvalidFeedback").show(); 910 $("#dateOfBirthForPartnerInvalidFeedback").show(); 911 912 } else { 913 $("#consentInvalidFeedback").hide(); 914 $("#dateOfBirthForPartnerInvalidFeedback").hide(); 915 } 916 } 917 918 //------------ Billing details ---------// 919 920 $("#billingDetailsSubmitButtonLoading").hide(); 921 922 $('#bankSelect').on('change', function () { 923 console.log('bankSelect on change!'); 924 if (this.value) {
925 $("#invalidBankFeedback").hide(); 926 } else { 927 $("#invalidBankFeedback").show(); 928 } 929 }); 930 931 $('#termsAndConditions').on('change', function () { 932 console.log('termsAndConditions on change!'); 933 if (this.checked) { 934 $("#billingDetailsSubmitButton").prop('disabled', false); 935 $("#invalidTnCFeedback").hide(); 936 } else { 937 $("#billingDetailsSubmitButton").prop('disabled', true); 938 $("#invalidTnCFeedback").show(); 939 } 940 }); 941 942 $("#billingDetailsForm").submit(function (e) { 943 console.log('Billing details submit!'); 944 $("#billingDetailsSubmitButton").hide(); 945 $("#billingDetailsSubmitButtonLoading").show(); 946 947 e.preventDefault(); 948 e.stopPropagation(); 949 950 if (this.checkValidity() === false) { 951 if ($('#bankSelect').val() == '' || $('#bankSelect').val() == null) { 952 $("#invalidBankFeedback").show(); 953 } 954 955 $("#billingDetailsSubmitButton").show(); 956 $("#billingDetailsSubmitButtonLoading").hide(); 957 958 } else { 959 this.submit(); 960 } 961 962 }); 963 964 //------------ Contract Summary ---------// 965 966 $("#contractSummarySubmitButtonLoading").hide(); 967 968 $("#contractSummaryForm").submit(function (e) { 969 console.log('contractSummaryForm on submit!'); 970 971 $("#contractSummarySubmitButton").hide(); 972 $("#contractSummarySubmitButtonLoading").show(); 973 974 e.preventDefault(); 975 e.stopPropagation(); 976 977 if (this.checkValidity() === false) { 978 $('#invalidMultiplyTnCFeedback').show(); 979 } else { 980 this.submit(); 981 } 982 983 }); 984 985 $('#contractTermsAndConditions').on('change', function () { 986 console.log('contractTermsAndConditions on change!'); 987 if (this.checked) { 988 $("#invalidMultiplyTnCFeedback").hide(); 989 } else { 990 $("#invalidMultiplyTnCFeedback").show(); 991 } 992 }); 993 994 $('#isMandatedAdvisor').on('change', function () { 995 console.log('isMandatedAdvisor on change!'); 996 if (this.checked) { 997 $("#mandatedBrokerHouseCodeInput").val($("#brokerHouseCodeInput").val); 998 $("#mandatedBrokerCodeInput").val($("#brokerCodeInput").val); 999 } else { 1000 $("#mandatedBrokerHouseCodeInput").val(); 1001 $("#mandatedBrokerCodeInput").val(); 1002 } 1003 }); 1004 1005 1006});
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.