Stop whitelist form autocompleting

The browser tries to be helpful by autofilling email addresses and
phone numbers. But it gets confused and tries to fill all the fields
with the same email address or phone number. This looks broken.

This commit disables autocomplete for these form fields.
This commit is contained in:
Chris Hill-Scott
2016-09-29 10:21:08 +01:00
parent 6c96b90922
commit fdeb2997fb
2 changed files with 5 additions and 1 deletions

View File

@@ -1,7 +1,8 @@
{% macro list_entry(
field,
item_name,
hint=''
hint='',
autocomplete=True
) %}
{% if error %}
@@ -40,6 +41,7 @@
id="input-{{ field.name }}-{{ index }}"
class="form-control form-control-1-1"
value="{{ field.data[index] }}"
{% if not autocomplete %}autocomplete="off"{% endif %}
/>
</div>
{% endfor %}

View File

@@ -22,11 +22,13 @@
{{ list_entry(
form.email_addresses,
item_name='email address',
autocomplete=False
) }}
{{ list_entry(
form.phone_numbers,
item_name='phone number',
autocomplete=False
) }}
</div>