Add autocomplete to email address on register form

GOV.UK Design System recommends:
> You should also set the autocomplete attribute to email. This lets
> browsers autofill the email address on a user’s behalf if they’ve
> entered it previously.

Only doing this on the register and sign in forms because it’s unlikely
to be helpful where a user is trying to enter someone else’s email
address.
This commit is contained in:
Chris Hill-Scott
2019-07-16 09:01:21 +01:00
parent 88242c31d1
commit 30eeaec154
4 changed files with 13 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ Create an account
<h1 class="heading-large">Create an account</h1>
{% call form_wrapper(autocomplete=True) %}
{{ textbox(form.name, width='3-4') }}
{{ textbox(form.email_address, hint="Must be from a government organisation", width='3-4', safe_error_message=True) }}
{{ textbox(form.email_address, hint="Must be from a government organisation", width='3-4', safe_error_message=True, autocomplete='email') }}
<div class="extra-tracking">
{{ textbox(form.mobile_number, width='3-4', hint='Well send you a security code by text message') }}
</div>

View File

@@ -32,7 +32,7 @@
{% endif %}
{% call form_wrapper(autocomplete=True) %}
{{ textbox(form.email_address) }}
{{ textbox(form.email_address, autocomplete='email') }}
{{ textbox(form.password) }}
{{ page_footer("Continue", secondary_link=url_for('.forgot_password'), secondary_link_text="Forgot your password?") }}
{% endcall %}