#8103 closed Bug (fixed)
Select widget should only allow for one selected option
Reported by: | Chris Beaven | Owned by: | Chris Beaven |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
According to http://www.w3.org/TR/html401/interact/forms.html#h-17.6.1 :
It is considered an error if more than one OPTION element has the selected attribute set and the SELECT element does not have the multiple attribute set.
Attachments (3)
Change History (13)
by , 16 years ago
comment:1 by , 16 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Unreviewed → Ready for checkin |
comment:2 by , 16 years ago
Triage Stage: | Ready for checkin → Design decision needed |
---|
Isn't this fixing the problem at the wrong point? Isn't the real error the fact that you have a choices definition with a duplicated index value?
comment:3 by , 16 years ago
But there's nothing wrong with that. Nothing in the spec says you can't have duplicated values for your options.
A common example, and one I was encountering, is using a separator between sections in your choices - ('', '-------')
. All of these will get have the selected attribute currently (which also has the unfortunate side-effect of the last one being selected rather than the first empty option - e.g. ('', 'ALL')
by , 14 years ago
Attachment: | 8103.2.diff added |
---|
comment:4 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:5 by , 13 years ago
Easy pickings: | unset |
---|---|
Triage Stage: | Design decision needed → Accepted |
UI/UX: | unset |
Marking accepted. The patch no longer applies, but once it does the approach is fine so feel free to commit or mark RFC.
comment:7 by , 13 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Patch with tests. It's a lot smaller in reality - it just cleans up some whitespace...