mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-08 20:33:47 -05:00
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.
55 lines
1.6 KiB
HTML
55 lines
1.6 KiB
HTML
{% macro list_entry(
|
|
field,
|
|
item_name,
|
|
hint='',
|
|
autocomplete=True
|
|
) %}
|
|
|
|
{% if error %}
|
|
<div class="validation-wrapper">
|
|
{% endif %}
|
|
<fieldset class="form-group{% if field.errors %} error{% endif %}" id="{{ field.name }}">
|
|
<legend>
|
|
<span class="form-label">
|
|
{{ field.label }}
|
|
{% if hint %}
|
|
<span class="form-hint">
|
|
{{ hint }}
|
|
</span>
|
|
{% endif %}
|
|
{% if field.errors %}
|
|
<span class="error-message">
|
|
{{ field.errors[0][0] }}
|
|
</span>
|
|
{% endif %}
|
|
</label>
|
|
</legend>
|
|
{% if hint %}
|
|
<span class="hint">
|
|
{{ hint }}
|
|
</span>
|
|
{% endif %}
|
|
<div class="input-list" data-module="list-entry" data-list-item-name="{{ item_name }}" id="list-entry-{{ field.name }}">
|
|
{% for index in range(0, field.entries|length) %}
|
|
<div class="list-entry">
|
|
<label for="input-{{ field.name }}-{{ index }}" class="text-box-number-label">
|
|
<span class="visuallyhidden">{{ item_name }} number </span>{{ index + 1 }}.
|
|
</label>
|
|
<input
|
|
type="text"
|
|
name="{{ field.name }}-{{ index }}"
|
|
id="input-{{ field.name }}-{{ index }}"
|
|
class="form-control form-control-1-1"
|
|
value="{{ field.data[index] }}"
|
|
{% if not autocomplete %}autocomplete="off"{% endif %}
|
|
/>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</fieldset>
|
|
{% if error %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|