Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed oninvdalid and oninput #4961

Open
wants to merge 1 commit into
base: epic_188588775_csp_enabled
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/assets/javascripts/inline_replacements.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,12 @@ $(document).on('ajax:success', function(){
document.getElementById('inputNewEmail').value="";
});
}
});

$(document).on('invalid', '.dependent-ssn-input', function() {
this.setCustomValidity($(this).data('error-message'))
});

$(document).on('input', '.dependent-ssn-input', function() {
this.setCustomValidity('')
});
8 changes: 4 additions & 4 deletions app/views/insured/family_members/_dependent_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@
%>
<% else %>
<% if EnrollRegistry.feature_enabled?(:ssn_ui_validation) %>
<%= f.text_field :ssn, placeholder: "000-00-0000", class: "required keep-label mask-ssn",
pattern: "(?!666|000|9\\d{2})\\d{3}[\\- ]{0,1}(?!00)\\d{2}[\\- ]{0,1}(?!0{4})\\d{4}", oninvalid: "this.setCustomValidity('#{l10n('insured.consumer_roles.invalid_ssn_error')}')",
oninput: "this.setCustomValidity('')",
disabled: readonly_status %>
<%= f.text_field :ssn, placeholder: "000-00-0000", class: "required keep-label mask-ssn dependent-ssn-input",
pattern: "(?!666|000|9\\d{2})\\d{3}[\\- ]{0,1}(?!00)\\d{2}[\\- ]{0,1}(?!0{4})\\d{4}",
disabled: readonly_status,
data: {'error_message': l10n('insured.consumer_roles.invalid_ssn_error')} %>
<% else %>
<%= f.text_field :ssn, placeholder: "000-00-0000", class: "required", disabled: readonly_status %>
<% end %>
Expand Down
Loading