Tuesday, October 4, 2011

Re: howto disable label for field in admin app form?

Source:
https://docs.djangoproject.com/en/dev/ref/forms/api/#configuring-html-label-tags
If auto_id is False, then the form output will not include <label> tags
nor id attributes:
f = ContactForm(auto_id=False)

I think, this is exactly what you want.

На Tue, 4 Oct 2011 14:34:56 +0200
Aljoša Mohorović <aljosa.mohorovic@gmail.com> написа:

> On Tue, Oct 4, 2011 at 2:22 PM, BILLION Sébastien
> <sebastien.billion@gmail.com> wrote:
> > It's a strange question...
> > You can replace an admin template with {% extends
> > "admin/change_form.html %} for example.
>
> i don't see why it's a strange question, i have a form field and i
> would like to disable rendering of label?
> i appreciate suggestions and did consider overriding admin templates
> but "admin/change_form.html" is messy and don't know if it's a smart
> thing to do in my case.
> i've expected some option where i can set label=None by overriding
> field/widget init and disable label.
> thanks for suggestions but i think i'll just use javascript to remove
> label.
>
> Aljosa
>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment