Opened 6 years ago

Closed 6 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: UI/UX:

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.

Change History (1)

comment:1 Changed 6 years ago by dc

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Use <input disabled="disabled" name="fred" value="stone" /> which is valid HTML, XHTML and works with Django forms.

Note: See TracTickets for help on using tickets.
Back to Top