diff --git a/django/forms/boundfield.py b/django/forms/boundfield.py index 98ac5b8208c..d56fa0ea3e1 100644 --- a/django/forms/boundfield.py +++ b/django/forms/boundfield.py @@ -296,9 +296,10 @@ class BoundField(RenderableFieldMixin): not attrs.get("aria-describedby") and not widget.attrs.get("aria-describedby") and self.field.help_text - and self.id_for_label + and not self.use_fieldset + and self.auto_id ): - attrs["aria-describedby"] = f"{self.id_for_label}_helptext" + attrs["aria-describedby"] = f"{self.auto_id}_helptext" return attrs @property diff --git a/django/forms/jinja2/django/forms/field.html b/django/forms/jinja2/django/forms/field.html index c8943d9481e..21035b72e46 100644 --- a/django/forms/jinja2/django/forms/field.html +++ b/django/forms/jinja2/django/forms/field.html @@ -4,7 +4,7 @@ {% else %} {% if field.label %}{{ field.label_tag() }}{% endif %} {% endif %} -{% if field.help_text %}