diff --git a/keycloak/themes/hmda/login/messages/messages_en.properties b/keycloak/themes/hmda/login/messages/messages_en.properties index 79c3ade..02c5d1d 100644 --- a/keycloak/themes/hmda/login/messages/messages_en.properties +++ b/keycloak/themes/hmda/login/messages/messages_en.properties @@ -1,4 +1,4 @@ -missingInstitutionMessage=• Please specify the financial institution(s) for which you will be filing HMDA data. +missingInstitutionMessage=• Please choose the financial institution(s) for which you will be filing from the list below your email address. invalidInstitutionMessage=• The financial institution {0} is not associated with {1} email domain. unknownEmailDomainMessage=• The email domain {0} is not in the known list of HMDA filer domains. institutionErrorMessage=• An error occurred while validating the financial institution(s) against the {0} email domain. diff --git a/keycloak/themes/hmda/login/resources/js/register.js b/keycloak/themes/hmda/login/resources/js/register.js index eb98a71..5e6958d 100644 --- a/keycloak/themes/hmda/login/resources/js/register.js +++ b/keycloak/themes/hmda/login/resources/js/register.js @@ -159,7 +159,11 @@ var lastEmail = null //Process email and make debounced request when typing in email field - email.on('blur keyup', function(e) { + email.on('blur keyup', checkEmail) + + checkEmail({}) + + function checkEmail(e) { var emailVal = email.val().trim() if (emailVal === lastEmail) return else lastEmail = emailVal @@ -172,13 +176,13 @@ // don't make the API call on tab keyup var domain = emailToDomain(emailVal) if ( - (emailExp.test(emailVal) && e.keyCode) || + emailExp.test(emailVal) || (e.type === 'blur' && domain !== '' && domain !== undefined) ) { debounceRequest(domain) } } - }) + } //Save institution to input when clicked $('#institutions').on('click', '.institutionsCheck', addInstitutionsToInput)