The form object has the initial values in a couple places in dicts.
Since it's a dict you can access it's fields with the dot-syntax. I
just successfully tried this on one of my forms::
{{ form.fields.FIELDNAME.initial }}
or::
{{ form.initial.FIELDNAME }}
Just watch that your view is
Hi there!
I was just wondering how to access the value I've set in the view with
Form(initial={'val':somevar}) in the template. Maybe field.value? No.
field.initial? No.
Any clues? Thanks!
--~--~-~--~~~---~--~~
You received this message because you are
2 matches
Mail list logo