Make sure to save it in a secure location. You will need it to access your account in the future.';// modalFooter sets up the footer of the modal, default inserts a form with all needed hidden fields// in order to perform a login when the "continue" button is clickedvar modalFooter = '';var fiName = 'Stifel Wealth Tracker';//imgAlt is used to populate the alt tag on the logovar imgAlt = fiName;function is_json(str) { try { JSON.parse(str); } catch (e) { return false; } return true;}// masking explained briefly:// 0 any single digit// 9 optional single digit// # any number of digits// A any single alphanumeric// a any number of alphanumeric// S any single letter// s any number of letters// maskMoney is special and always requires inputClass: 'currency'let enrollmentObj = [ { tabTitle: 'Personal', enrollmentType: 'retail', tabActive: 'active', idPrepend: 'valrt_', data: [{ sectionHeader: ' ', fields: { Email: { label: 'Email', hint: 'Email Address where you would receive secure access codes', inputType: 'text', minLength: 5, maxLength: 50, notEmptyMessage: function () {return 'Email is required.'}, regexp: function(){return new RegExp(/^\s*(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9_]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}\s*$/i);}, regexpMessage: function(){return 'The Email Address you entered does not appear to be valid. Please enter it in the format: email@q.c';}},MobilePhone: { label: 'Mobile Phone Number', inputType: 'tel', minLength: 13, maxLength: 13, mask: '(000)000-0000', regexp: function () { return new RegExp(/^\([2-9]\d{2}\)\d{3}-\d{4}/) }, notEmptyMessage: function () { return 'Mobile Phone Number is required'; }, regexpMessage: function () { return 'The Mobile Phone Number you entered does not appear to be valid. Please enter it in the format: (000)000-0000'; }},FirstName: { label: 'First Name', inputType: 'text', minLength: 2, maxLength: 30, notEmptyMessage: function () { return 'First Name is required.'; }, regexp: function () { return new RegExp(/^[a-zA-Z '-]{2,30}$/); }, regexpMessage: function () { return 'The First Name you entered must be 1-30 characters and must not have any special characters or numbers.'; }},LastName: { label: 'Last Name', inputType: 'text', minLength: 0, maxLength: 30, regexp: function () { return new RegExp(/^[a-zA-Z '-]{0,30}$/); }, regexpMessage: function () { return 'Please enter a valid Last Name'; }},Password: { label: 'Password', inputType: 'password', minLength: 8, maxLength: 22, lengthReqMsg: 'It must be 8-22 characters.', lowerCaseReq: '(?=.*[a-z])', lowerCaseReqMsg: 'It must have at least 1 lower case character.', upperCaseReq: '(?=.*[A-Z])', upperCaseReqMsg: 'It must have at least 1 upper case character.', numbersReq: '(?=.*[0-9])', numbersReqMsg: 'It must have at least 1 number.', specialCharReq: '', specialCharReqMsg: '', illegal: '', notEmptyMessage: function () { return 'Password is required'; }, regexp: function () { return new RegExp('^(?!.*[' + this.illegal + '])(?=.{1,})' + this.lowerCaseReq + this.upperCaseReq + this.numbersReq + this.specialCharReq + '.{' + 8 + ',' + 22 + '}$'); }, regexpMessage: function () { return 'Passwords have the following requirements:' + this.lengthReqMsg + this.lowerCaseReqMsg + this.upperCaseReqMsg + this.numbersReqMsg + this.specialCharReqMsg; }},LoginID: { label: 'Username', inputType:'text', minLength:8, maxLength:16, hint:"Please do not use the following characters in your login ID: ,!%*/\ \'", notEmptyMessage: function () {return 'Login ID is required';}, regexp: function(){return new RegExp(/(?=.*?[A-Za-z])(^[^,!%*/\ \']{8,16}$)/);}, regexpMessage: function(){return 'Login ID does not meet requirements. Login ID must be 8 - 16 characters, must contain at least one letter, and may not contain these special characters: ,!%*/\ \'';}} } }] }];let enrollmentObjClient = [ { tabTitle: 'Personal', enrollmentType: 'retail', tabActive: 'active', idPrepend: 'valrt_', data: [{ sectionHeader: ' ', fields: { AccountNum: { label: 'Stifel Account Number', inputType: 'tel', minLength: 9, maxLength: 9, mask: '0000-0000', notEmptyMessage: function () { return 'Account Number is required'; }, regexp: function () { return new RegExp(/^\d{4}-\d{4}/); }, regexpMessage: function () { return 'Please enter a valid account number'; }},DOB: { label: 'Date of Birth', hint: 'Member DOB (mm/dd/yyyy)', inputType: 'tel', minLength: 8, maxLength: 10, mask: '00/00/0000', regexp: function () { return new RegExp(/^\d{1,2}\/\d{1,2}\/\d{4}/); }, notEmptyMessage: function () { return 'Date of Birth is required.'; }, regexpMessage: function () { return 'Please enter date in the format: mm/dd/yyyy'; }},SocialSecurity: { label: 'Social Security Number', hint:"Primary member's SSN (123-45-6789)", inputType: 'tel', minLength: 11, maxLength: 11, mask: '000-00-0000', regexp: function () { return new RegExp(/^\d{3}-\d{2}-\d{4}/) }, notEmptyMessage: function () { return 'Social Security Number is required'; }, regexpMessage: function () { return 'Please enter a valid Social Security Number'; }},LoginID: { label: 'Username', inputType:'text', minLength:8, maxLength:16, hint:"Please do not use the following characters in your login ID: ,!%*/\ \'", notEmptyMessage: function () {return 'Login ID is required';}, regexp: function(){return new RegExp(/(?=.*?[A-Za-z])(^[^,!%*/\ \']{8,16}$)/);}, regexpMessage: function(){return 'Login ID does not meet requirements. Login ID must be 8 - 16 characters, must contain at least one letter, and may not contain these special characters: ,!%*/\ \'';}} } }] }];let enrollmentObjEmailTaken = [ { tabTitle: 'Personal', enrollmentType: 'retail', tabActive: 'active', idPrepend: 'valrt_', data: [{ sectionHeader: ' ', fields: { Email: { label: 'Email', hint: 'Email Address where you would receive secure access codes', inputType: 'text', minLength: 5, maxLength: 50, notEmptyMessage: function () {return 'Email is required.'}, regexp: function(){return new RegExp(/^\s*(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9_]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}\s*$/i);}, regexpMessage: function(){return 'The Email Address you entered does not appear to be valid. Please enter it in the format: email@q.c';}},LoginID: { label: 'Username', inputType:'text', minLength:8, maxLength:16, hint:"Please do not use the following characters in your login ID: ,!%*/\ \'", notEmptyMessage: function () {return 'Login ID is required';}, regexp: function(){return new RegExp(/(?=.*?[A-Za-z])(^[^,!%*/\ \']{8,16}$)/);}, regexpMessage: function(){return 'Login ID does not meet requirements. Login ID must be 8 - 16 characters, must contain at least one letter, and may not contain these special characters: ,!%*/\ \'';}} } }] }];let enrollmentObjPhoneTaken = [ { tabTitle: 'Personal', enrollmentType: 'retail', tabActive: 'active', idPrepend: 'valrt_', data: [{ sectionHeader: ' ', fields: { MobilePhone: { label: 'Mobile Phone Number', inputType: 'tel', minLength: 13, maxLength: 13, mask: '(000)000-0000', regexp: function () { return new RegExp(/^\([2-9]\d{2}\)\d{3}-\d{4}/) }, notEmptyMessage: function () { return 'Mobile Phone Number is required'; }, regexpMessage: function () { return 'The Mobile Phone Number you entered does not appear to be valid. Please enter it in the format: (000)000-0000'; }},LoginID: { label: 'Username', inputType:'text', minLength:8, maxLength:16, hint:"Please do not use the following characters in your login ID: ,!%*/\ \'", notEmptyMessage: function () {return 'Login ID is required';}, regexp: function(){return new RegExp(/(?=.*?[A-Za-z])(^[^,!%*/\ \']{8,16}$)/);}, regexpMessage: function(){return 'Login ID does not meet requirements. Login ID must be 8 - 16 characters, must contain at least one letter, and may not contain these special characters: ,!%*/\ \'';}} } }] }];let isFormSubmitted = false;// // //// // // Shouldn't need to change anything below here...// // //function loginIdCheck() { var fv = $('#OnlineEnrollment_personal').data('formValidation'); var ssn = $('#valrt_SocialSecurity').val().replace(/\-/g, ''); var loginID = $('#valrt_LoginID').val(); if (loginID === ssn) { fv.updateMessage('LoginID', 'blank', 'Requested Login ID cannot match your social security number or member number.'); fv.updateStatus('LoginID', 'INVALID', 'blank'); }}function emailCheck() { var fv = $('#OnlineEnrollment_personal').data('formValidation'); var email1 = $('#valrt_Email1').val(); var email2 = $('#valrt_Email2').val(); if (email1 !== email2) { fv.updateMessage('Email2', 'blank', 'Email 2 must match Email 1.'); fv.updateStatus('Email2', 'INVALID', 'blank'); }}function focusInput(elem) { elem.previousSibling.style.zIndex = "1002";}function blurInput(elem) { elem.previousSibling.style.zIndex = "100";}function submit_form(formId) { $('#' + formName + '_' + formId).data('formValidation').resetForm(); $('#' + formName + '_' + formId).data('formValidation').validate(); if ($('#submit_button_' + formName + '_' + formId).is(':disabled')) { return false; } else if ($('#' + formName + '_' + formId).data('formValidation').isValid() && !($('select[name=' + formName + '_' + formId + ']').length > 0 && $('select[name=' + formName + '_' + formId + ']').val() == '')) { $('#' + formName + '_' + formId + 'alertBox').addClass("hidden"); $('#alertBox_security').addClass("hidden"); var param_string = create_param_string(); $('#submit_button_' + formName + '_' + formId).attr('disabled', 'disabled'); $('#submit_button_' + formName + '_' + formId).html('Please wait'); // make this call when the content starts to load sr_message('Please wait'); var $frm = $("#" + formName + "_" + formId); var $sec_q = $('#security_questions'); $sec_q.remove(); $('
').attr({class: 'hidden', id: 'security_questions'}).appendTo($frm); var $sec_q = $('#security_questions'); $('').attr({id: 'FavoriteColor', name: 'FavoriteColor'}).appendTo($sec_q); $('').attr({id: 'FirstCar', name: 'FirstCar'}).appendTo($sec_q); $('').attr({id: 'PetsName', name: 'PetsName'}).appendTo($sec_q); validation_sum(); var enabled_fields = $("input:not(:disabled),button:not(:disabled)"); let post_data = $frm.serialize(); enabled_fields.prop("disabled", true); $.ajax({ type: $frm.attr("method"), data: post_data, dataType: "text", success: function (response, textStatus, jqXHR) { var reenable_fields = true; if (is_json(response)) { reenable_fields = process_form(true, response, formId, jqXHR); } else { reenable_fields = process_form(false, response, formId); } if (reenable_fields) { enabled_fields.prop("disabled", false); } enabled_fields = null; }, error: function (xhr, details, error) { process_form(false, "", formId); enabled_fields.prop("disabled", false); enabled_fields = null; } }); } else { //Notify Screen reader that form fields are invalid. sr_message('Your form was not submitted because not all fields were completed correctly. Please verify that all information is correct.'); // form isn't valid, focus first invalid field if (!$('#' + formName + '_' + formId).data('formValidation').isValid()) { $('#' + $('#' + formName + '_' + formId).data('formValidation').getInvalidFields()[0].id).focus(); $(document.body).animate({ 'scrollTop': $('#' + $('#' + formName + '_' + formId).data('formValidation').getInvalidFields()[0].id).prev('label').offset().top - 20 }, 250); if ($('select[name=' + formName + '_' + formId + ']').length > 0 && $('select[name=' + formName + '_' + formId + ']').val() == '') { set_security_error(false); } } else if ($('select[name=' + formName + '_' + formId + ']').length > 0 && $('select[name=' + formName + '_' + formId + ']').val() == '') { set_security_error(true); } } return false;}function set_error(message, formId) { //$('div.modal-msg').html(message); $('#' + formName + '_' + formId + ' div.modal-msg').html(message); $('#' + formName + '_' + formId + 'alertBox').removeClass("hidden"); $("html, body").animate({ 'scrollTop': $('#' + formName + '_' + formId + 'alertBox').offset().top }, 250); //Trigger Screen Reader Message sr_message('Alert. ' + message);}function set_security_error(scroll) { $('#alertBox_security').removeClass("hidden"); if (scroll) { $(document.body).animate({ 'scrollTop': $('#alertBox_security').offset().top - 20 }, 250); } //Trigger Screen Reader Message sr_message('Alert. ' + message);}function process_form(success, data, formId, jqXHR) { if (success) { var json = $.parseJSON(data); hide_enroll_help(); // Create do_login function if we submitted username & password if($("#valrt_Password").val() && $("#valrt_LoginID").val()){ do_login = function(){ let username = $("#valrt_LoginID").val(); let password = $("#valrt_Password").val(); return function(){ $("