Opened 9 years ago

Closed 8 years ago

#6270 closed (wontfix)

There should be a way to easy edit a form's label_tag output!

Reported by: italomaia Owned by: David Tulig
Component: Forms Version: master
Severity: Keywords: label, edit
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Well, for what i noticed, label_tag output is plain text, so, using a filter for the change would be difficult.
Something like: if you would like your filed help_text to become you label's title, so that a javascript framework
could get all your labels titles and make good looking "tip boxes" for them, how could one acomplish that?
It would be necessary to subclass ModelForm or Form, or even create some bad looking filters...bad solution.
A suggestion for the work would be that the label_tag output was not plain text, but an object, widget-like.
So that a object.widget.attrs.update({'title':value}) could be used through filters, or even a option for
the described behavior ( help_text as the label's title ).
I believe that would make the web-designers lifes easier.

Attachments (1)

label_attrs.diff (3.1 KB) - added by David Tulig 9 years ago.
Adds "label_attrs" to the Field constructor to define attributes for the label tag

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by David Tulig

Attachment: label_attrs.diff added

Adds "label_attrs" to the Field constructor to define attributes for the label tag

comment:1 Changed 9 years ago by David Tulig

Has patch: set
Owner: changed from nobody to David Tulig
Status: newassigned

comment:2 Changed 8 years ago by Jacob

Resolution: wontfix
Status: assignedclosed

If you need custom label attributes you ought to simply do that at the template level. Something like <label class="woo">{{ field.label }}</label>{{ field }}.

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