List Info

Thread: hide fields using newforms




hide fields using newforms
user name
2007-12-30 10:04:52
Hello,
using newforms how can I set fields to be hidden (the
hidden="hidden"  
attribute)?

Thanks,

Florian

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


Re: hide fields using newforms
user name
2007-12-30 10:11:23
On Dec 30, 5:04 pm, Florian Lindner <mailingli...xgm.de> wrote:
> Hello,
> using newforms how can I set fields to be hidden (the
hidden="hidden"
> attribute)?

Did you mean type="hidden" ?
http://www.djangoproject.com/documentation/newforms/
#widgets

You can create your own widget if you need to.

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


Re: hide fields using newforms
user name
2007-12-30 15:36:48
On Dec 30, 2007 11:11 AM, l5x <mail.loocasgmail.com> wrote:
>
> On Dec 30, 5:04 pm, Florian Lindner
<mailingli...xgm.de> wrote:
> > Hello,
> > using newforms how can I set fields to be hidden
(the hidden="hidden"
> > attribute)?
>
> Did you mean type="hidden" ?
> http://www.djangoproject.com/documentation/newforms/
#widgets
>
> You can create your own widget if you need to.
>

Or you can just use the HiddenInput widget that already
exists. Here's
how you'd declare a hidden text field:

class SomeForm(forms.Form):
    my_text = forms.CharField(max_length=20,
widget=forms.HiddenInput)

HTH,
Todd

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


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )