On Sep 29, 2010, at 5:08 PM, aa56280 wrote:
> Can't you specify the value using the initial argument?
> http://docs.djangoproject.com/en/dev/ref/forms/fields/#initial
>
>
I did that originally, but it doesn't show up when the HiddenInput renders.
That's why I stopped changing the widget.
Sh
Can't you specify the value using the initial argument?
http://docs.djangoproject.com/en/dev/ref/forms/fields/#initial
On Sep 29, 3:33 pm, Shawn Milochik wrote:
> Actually, I spoke too soon on this one. My original solution doesn't work
> because the hidden input on the form doesn't have a valu
Actually, I spoke too soon on this one. My original solution doesn't work
because the hidden input on the form doesn't have a value, so the form won't
validate.
I fixed this by just adding display: none to the widget attrs in the __init__
instead of changing the widget to a HiddenInput. Now the
That seems pretty straightforward me. You want to customize the form
based on the user and so you're doing it when the form is initialized.
Makes perfect sense.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
I ran into an interesting forms issue today which I came up with a solution
for. Now I'm wondering if there's a better way.
Situation:
I have a forms.Form with several fields in it, including a ChoiceField. The
values in this ChoiceField are dependent on what the user has access to. Many
users
5 matches
Mail list logo