summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorDavid Smith <smithdc@gmail.com>2023-11-19 19:26:12 +0000
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-01-02 16:40:39 +0100
commit987854ba44b497b195536199f8f6d1dc440a43ca (patch)
treeeeea09834948a15551ced9156fe3bd91ff0f3ba4 /django/forms
parent53df2ee7a42cf965126839b59308e49b58007669 (diff)
Fixed #32819 -- Added aria-describedby to fields with errors.
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/boundfield.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/forms/boundfield.py b/django/forms/boundfield.py
index 4d3cd88660..c0324d5c1d 100644
--- a/django/forms/boundfield.py
+++ b/django/forms/boundfield.py
@@ -305,6 +305,8 @@ class BoundField(RenderableFieldMixin):
if self.auto_id and not self.is_hidden:
if self.help_text:
aria_describedby.append(f"{self.auto_id}_helptext")
+ if self.errors:
+ aria_describedby.append(f"{self.auto_id}_error")
return " ".join(aria_describedby)
@property