Forms need aria labels for accessibility:
- Rename
ref_id to form_dom_id to indicate that this is an identifier in the DOM
- All labels, descriptions and error messages accompanying a field should have
id tags in the form {{ form_dom_id }}-label, -description, -error-0, etc. Since there could be multiple errors, they need to be indexed.
- The fields themselves need two additional ARIA tags:
aria-describedby which has all of the above ids, separated by spaces
aria-invalid, whose value is {% if field.errors %}true{% else %}false{% endif %}
Forms need
arialabels for accessibility:ref_idtoform_dom_idto indicate that this is an identifier in the DOMidtags in the form{{ form_dom_id }}-label,-description,-error-0, etc. Since there could be multiple errors, they need to be indexed.aria-describedbywhich has all of the above ids, separated by spacesaria-invalid, whose value is{% if field.errors %}true{% else %}false{% endif %}