1
0
mirror of https://github.com/django/django.git synced 2024-12-27 11:35:53 +00:00
django/docs/topics/forms
David Smith 7f0275d8cb [5.0.x] Refs #32819 -- Used auto_id instead of id_for_label as unique identifier for the field.
`id_for_label` is blank for widgets with multiple inputs such as radios
and multiple checkboxes. Therefore , `help_text` for fields using these
widgets cannot currently be associated using `aria-describedby`.
`id_for_label` is being used as a guard to avoid incorrectly adding
`aria-describedby` to those widgets.

This change uses `auto_id` as the unique identified for the fields
`help_text`. A guard is added to avoid incorrectly adding
`aria-describedby` to inputs by checking the widget's `use_fieldset`
attribute. Fields rendered in a `<fieldset>` should have
`aria-describedby` added to the `<fieldset>` and not every `<input>`.

Backport of 292f1ea90f from main
2023-11-16 13:27:18 +01:00
..
formsets.txt Improved formset docs by using a set instead of a list in the custom validation example. 2023-08-23 22:24:43 -03:00
index.txt [5.0.x] Refs #32819 -- Used auto_id instead of id_for_label as unique identifier for the field. 2023-11-16 13:27:18 +01:00
media.txt Fixed #34140 -- Reformatted code blocks in docs with blacken-docs. 2023-03-01 13:03:56 +01:00
modelforms.txt Fixed #31262 -- Added support for mappings on model fields and ChoiceField's choices. 2023-08-30 22:57:40 -03:00