mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 04:59:37 -04:00
Fix duplicate labels on form inputs
It’s invalid HTML to have multiple labels nested within each other. This
was happening by accident because WTForms tries to be clever – when you
put `{{ field.label }}` in a template it prints a `<label>` tag for you,
not just the text of the label. But we put our own `<label>` tags in the
HTML to have more control of them.
This commit stops WTForms being so clever.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<div class="form-group {% if field.errors %} error{% endif %}">
|
||||
<fieldset>
|
||||
<legend class="form-label">
|
||||
{{ field.label }}
|
||||
{{ field.label.text }}
|
||||
{% if field.errors %}
|
||||
<span class="error-message">
|
||||
{{ field.errors[0] }}
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class="{{ wrapping_class }} {% if field.errors %} error{% endif %}">
|
||||
<fieldset>
|
||||
<legend class="form-label">
|
||||
{{ field.label }}
|
||||
{{ field.label.text }}
|
||||
{% if field.errors %}
|
||||
<span class="error-message">
|
||||
{{ field.errors[0] }}
|
||||
@@ -80,7 +80,7 @@
|
||||
<div class="form-group {% if field.errors %} error{% endif %}">
|
||||
<fieldset>
|
||||
<legend class="form-label">
|
||||
{{ field.label }}
|
||||
{{ field.label.text }}
|
||||
{% if field.errors %}
|
||||
<span class="error-message">
|
||||
{{ field.errors[0] }}
|
||||
|
||||
Reference in New Issue
Block a user