Code

Opened 5 years ago

Closed 5 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.

Attachments (0)

Change History (1)

comment:1 Changed 5 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.