Opened 15 years ago
Closed 15 years ago
#11177 closed (invalid)
widget attributes
Reported by: | fback | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There are at least two attributes (disabled and readonly, anything else?) for misc. form fields that don't have parameter. Because attrs is a dictionary, every key needs a value. When value is set to None, it finally renders to attribute="None"
:
There should be a way to pass attributes without value (maybe using None as a value?). Current e.g. <input disabled="1" name="fred" value="stone">
works under every browser I was able to test, but it doesn't change the fact it's not valid html.
Use <input disabled="disabled" name="fred" value="stone" /> which is valid HTML, XHTML and works with Django forms.