Skip to content

Commit

Permalink
Change span to label so for attribute works
Browse files Browse the repository at this point in the history
  • Loading branch information
hnryjmes authored and kevincarrogan committed Jan 14, 2025
1 parent b03f8eb commit d845f8a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lite_forms/templates/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@
</label>
{% endif %}
{% if question.description %}
<span class="govuk-hint" for="{{ question.name }}">
<label class="govuk-hint" for="{{ question.name }}">
<span>{{ question.description|safe }}</span>
</span>
</label>
{% endif %}
{% if question.accessible_description %}
<span class="govuk-hint govuk-visually-hidden" for="{{ question.name }}">
<label class="govuk-hint govuk-visually-hidden" for="{{ question.name }}">
{{ question.accessible_description }}
</span>
</label>
{% endif %}

<!-- Error -->
{% if errors %}
{% if errors|key_value:question.name and question.input_type != "hidden" %}
<span id="error-{{ question.name }}" for="{{ question.name }}" class="govuk-error-message">
<label id="error-{{ question.name }}" for="{{ question.name }}" class="govuk-error-message">
<span class="govuk-visually-hidden">Error:</span>
{% for error in errors|key_value:question.name %}
{{ error }}
{% endfor %}
</span>
</label>
{% endif %}
{% endif %}

Expand Down

0 comments on commit d845f8a

Please sign in to comment.