Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#3686 closed (duplicate)

Set class name to "required" for labels which corresponds to required fields

Reported by: ramzes@… Owned by: Adrian Holovaty
Component: Forms Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: yes
Easy pickings: UI/UX:

Description

I need some way to mark required field in html code returned by form.as_...() . The proposal is to set class name as "required" for labels of that fields.

Attachments (1)

required_label.diff (2.1 KB) - added by ramzes@… 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by ramzes@…

Attachment: required_label.diff added

comment:1 Changed 10 years ago by James Bennett

Needs documentation: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

I'd actually feel happier about having this passed automatically to the widgets, regardless of whether one of the as methods is being used; that way it works everywhere. Also, documentation which mentions that this will happen would be nice :)

comment:2 Changed 10 years ago by Gary Wilson <gary.wilson@…>

Summary: [patch] Set class name to "required" for labels which corresponds to required fieldsSet class name to "required" for labels which corresponds to required fields

#3898 marked as a duplicate.

See also #3512 which has a patch for adding classes to the container elements in the as_* methods instead.

comment:3 Changed 9 years ago by Chris Beaven

Needs tests: set
Resolution: duplicate
Status: newclosed

#3898 wasn't a duplicate, but #3515 is. I'll close this one and reference it there.

Hrm... and since ubernostrum is pro this method, I'll reopen #3515.

comment:4 Changed 9 years ago by Gabriel Farrell <gsf@…>

After a good amount of searching for a simple way to highlight required fields in my as_* form, I found this patch. It's exactly what I need, and much more specific than #3515. I'd much rather get this guy into trunk than all of the earth-moving going on at #3515. Any chance we could reopen?

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