Skip to content

Commit a0d56b1

Browse files
committed
fix: update form validation actions to use checkValidity for improved error handling
1 parent 787e524 commit a0d56b1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/views/better_together/wizard_step_definitions/host_setup/admin_creation.html.erb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<%= f.label :email, t('.fields.email.label'), class: 'form-label' %>
5252
<%= f.email_field :email, autofocus: true, required: true,
5353
class: "form-control#{' is-invalid' if @form.errors[:email].any?}",
54-
data: { action: 'blur->better_together--form-validation#validate' } %>
54+
data: { action: 'blur->better_together--form-validation#checkValidity' } %>
5555
<small class="form-text text-muted"><%= t('.fields.email.help') %></small>
5656
<% if @form.errors[:email].any? %>
5757
<div class="invalid-feedback d-block"><%= @form.errors[:email].join(', ') %></div>
@@ -63,7 +63,7 @@
6363
<%= f.label :password, t('.fields.password.label'), class: 'form-label' %>
6464
<%= f.password_field :password, required: true, minlength: min_password_length,
6565
class: "form-control#{' is-invalid' if @form.errors[:password].any?}",
66-
data: { action: 'blur->better_together--form-validation#validate', 'better_together--form-validation-min-length-value': min_password_length } %>
66+
data: { action: 'blur->better_together--form-validation#checkValidity', 'better_together--form-validation-min-length-value': min_password_length } %>
6767
<small class="form-text text-muted">
6868
<%= t('.fields.password.help', min_length: min_password_length) %>
6969
</small>
@@ -77,7 +77,7 @@
7777
<%= f.label :password_confirmation, t('.fields.password_confirmation.label'), class: 'form-label' %>
7878
<%= f.password_field :password_confirmation, required: true, minlength: min_password_length,
7979
class: "form-control#{' is-invalid' if @form.errors[:password_confirmation].any?}",
80-
data: { action: 'blur->better_together--form-validation#validate', 'better_together--form-validation-min-length-value': min_password_length } %>
80+
data: { action: 'blur->better_together--form-validation#checkValidity', 'better_together--form-validation-min-length-value': min_password_length } %>
8181
<% if @form.errors[:password_confirmation].any? %>
8282
<div class="invalid-feedback d-block"><%= @form.errors[:password_confirmation].join(', ') %></div>
8383
<% end %>
@@ -95,7 +95,7 @@
9595
<%= person_form.label :name, t('.fields.name.label'), class: 'form-label' %>
9696
<%= person_form.text_field :name, required: true,
9797
class: "form-control#{' is-invalid' if @form.errors[:name].any?}",
98-
data: { action: 'blur->better_together--form-validation#validate' } %>
98+
data: { action: 'blur->better_together--form-validation#checkValidity' } %>
9999
<small class="form-text text-muted">
100100
<%= t('.fields.name.help') %>
101101
</small>
@@ -109,7 +109,7 @@
109109
<%= person_form.label :identifier, t('.fields.identifier.label'), class: 'form-label' %>
110110
<%= person_form.text_field :identifier, required: true,
111111
class: "form-control#{' is-invalid' if @form.errors[:identifier].any?}",
112-
data: { action: 'blur->better_together--form-validation#validate' } %>
112+
data: { action: 'blur->better_together--form-validation#checkValidity' } %>
113113
<small class="form-text text-muted">
114114
<%= t('.fields.identifier.help') %>
115115
</small>
@@ -123,7 +123,7 @@
123123
<%= person_form.label :description, t('.fields.description.label'), class: 'form-label' %>
124124
<%= person_form.text_area :description, required: true, rows: 3,
125125
class: "form-control#{' is-invalid' if @form.errors[:description].any?}",
126-
data: { action: 'blur->better_together--form-validation#validate' } %>
126+
data: { action: 'blur->better_together--form-validation#checkValidity' } %>
127127
<small class="form-text text-muted">
128128
<%= t('.fields.description.help') %>
129129
</small>

0 commit comments

Comments
 (0)