Skip to content

Commit

Permalink
removed oninvdalid and oninput
Browse files Browse the repository at this point in the history
  • Loading branch information
anncaballeroo committed Jan 24, 2025
1 parent 99c925c commit b525af3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
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

0 comments on commit b525af3

Please sign in to comment.