#3064 closed defect (fixed)
[patch] newforms should use <label>
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | normal | Keywords: | newforms |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
newforms should use <label> tags form field names for two reasons
- Accessibility Reasons
- Semantic Markup (for those CSS purists)
See:
http://www.cita.uiuc.edu/html-best-practices/nav/forms.php
http://simon.incutio.com/archive/2003/02/11/labelElements
http://www.netmechanic.com/news/vol7/accessibility_no2.htm
Problems that would be faced are that currently auto_id is off by default - to use label tags newforms would require it to be on.
Any thoughts?
Attachments (1)
Change History (10)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Component: | Core framework → django.newforms |
---|
comment:3 by , 18 years ago
SmileyChris -- that suggestion sounds good. Let's apply the <label>
only to fields that have an ID (either manual or auto).
by , 18 years ago
Attachment: | newforms_label.patch added |
---|
comment:5 by , 18 years ago
Summary: | newforms should use <label> → [patch] newforms should use <label> |
---|
comment:6 by , 18 years ago
In widgets.py
, class RadioInput(object)
has uses a <label>
tag. I haven't changed that or really looked closely at it, so you might want to make sure that's ok.
Since I did the patch, I better leave you something to do. ;)
comment:7 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I agree (as I suggested in my #3023 patch which attempted to do way too much at once)
My suggestion is that label tags are only applied to fields which have an ID (either manual or auto).
auto_id
still isn't required this way.