Use a label in the email verification email field

We were using a paragraph before the field, and then a field with no
label and a redundant placeholder. This causes accessibility issues for
screen reader users, who will not hear the label being announced when
entering the field, and to users who click on the label expecting it to
automatically focus on its related field (which is the standard browser
behavior).
This commit is contained in:
Javi Martín
2021-06-16 15:18:44 +02:00
parent 1632540984
commit 24d758ee64
3 changed files with 1 additions and 5 deletions

View File

@@ -6,14 +6,12 @@
<li>
<strong><%= t("management.email_verifications.if_existing_account") %></strong>
<p><%= t("management.email_verifications.introduce_email") %></p>
<%= form_for @email_verification,
as: :email_verification,
url: management_email_verifications_path do |f| %>
<%= f.hidden_field :document_type %>
<%= f.hidden_field :document_number %>
<%= f.text_field :email, label: false, placeholder: t("management.email_verifications.email_placeholder") %>
<%= f.text_field :email, label: t("management.email_verifications.introduce_email") %>
<%= f.submit t("management.email_verifications.send_email"), class: "button hollow" %>
<% end %>

View File

@@ -49,7 +49,6 @@ en:
choose_options: "Please choose one of the following options:"
document_found_in_census: This document was found in the census, but it has no user account associated to it.
document_mismatch: "This email belongs to a user which already has an associated id: %{document_number}(%{document_type})"
email_placeholder: Write the email this person used to create his or her account
email_sent_instructions: In order to completely verify this user, it is necessary that the user clicks on a link which we have sent to the email address above. This step is needed in order to confirm that the address belongs to him.
if_existing_account: If the person has already a user account created in the website,
if_no_existing_account: If this person has not created an account yet

View File

@@ -49,7 +49,6 @@ es:
choose_options: "Elige una de las opciones siguientes:"
document_found_in_census: Este documento está en el registro del padrón municipal, pero todavía no tiene una cuenta de usuario asociada.
document_mismatch: "Ese email corresponde a un usuario que ya tiene asociado el documento %{document_number}(%{document_type})"
email_placeholder: Introduce el email de registro
email_sent_instructions: Para terminar de verificar esta cuenta es necesario que haga clic en el enlace que le hemos enviado a la dirección de correo que figura arriba. Este paso es necesario para confirmar que dicha cuenta de usuario es suya.
if_existing_account: Si la persona ya ha creado una cuenta de usuario en la web
if_no_existing_account: Si la persona todavía no ha creado una cuenta de usuario en la web