[Django] #36949: Missing label on each <select> in a fieldset

0 views
Skip to first unread message

Django

unread,
Feb 24, 2026, 5:15:27 PM (8 days ago) Feb 24
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob | Owner: Eliana Rosselli
Walls |
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Normal | Keywords: accessibility,
Triage Stage: | fieldset
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
As Thibaud mentioned
[https://github.com/django/django/pull/15317#discussion_r835962239 here]
when `use_fieldset` was added to forms, we're lacking a label on each
`<select>` element in a `<fieldset>`, even though a `<legend>` is present
for the fieldset.

Now that the admin uses `Widget.use_fieldset` since #35892, it's easy to
reproduce by just checking a `ForeignKey` field in the admin:

Then, in Chrome Dev Tools, the lighthouse tab reports:

> Select elements do not have associated label elements.


Pure forms reproducer, in a shell:

{{{#!py
from django.db import models
from django import forms

class Person(models.Model):
best_friend = models.ForeignKey(
"auth.User",
models.CASCADE,
)
class Meta:
app_label = "myapp.Person"

class MyWidget(forms.Select):
use_fieldset = True

class PersonForm(forms.ModelForm):
class Meta:
model = Person
fields = ["best_friend"]
widgets = {"best_friend": MyWidget}

print(PersonForm().as_p())
}}}
{{{#!py
<p>
<label for="id_best_friend">Best friend:</label>
<select name="best_friend" required id="id_best_friend">
<option value="" selected>---------</option>

<option value="2">anonymous</option>

<option value="1">admin</option>

</select>




</p>
}}}


----
Tentatively assigning to Eli as a Djangonaut Space navigator to evaluate
if a good fit for anyone.
--
Ticket URL: <https://code.djangoproject.com/ticket/36949>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 24, 2026, 5:19:38 PM (8 days ago) Feb 24
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Eliana
| Rosselli
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage:
fieldset | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

There's some relevant advice in a related ticket: ticket:36509#comment:1
--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:1>

Django

unread,
Mar 2, 2026, 3:49:21 PM (2 days ago) Mar 2
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Eliana
| Rosselli
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
fieldset |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* cc: Eliana Rosselli (added)
* stage: Unreviewed => Accepted

Comment:

Thank you!
--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:2>
Reply all
Reply to author
Forward
0 new messages