Re: Using the form field values in templates

2010-01-29 Thread Adrian Maier
Shawn, Ondrey, Thanks for your answers. I ended up using to ModelForm and ModelFormSet. Cheers, Adrian On Tue, Jan 19, 2010 at 16:12, ondrey wrote: > Hi, > > if the form is bound (i.e. form.is_bound is true) then you can access > its data attribute, which contains

Re: Using the form field values in templates

2010-01-19 Thread ondrey
Hi, if the form is bound (i.e. form.is_bound is true) then you can access its data attribute, which contains the data entered into the form. If the form is valid (i.e. form.is_valid() is true), then you can access the cleaned_data attributes as well. So for example if you have form like this: f

Re: Using the form field values in templates

2010-01-18 Thread Shawn Milochik
This is something I've run into as well. If it's a forms.ModelForm, and you instantiated it by passing an instance, you can access it like this: {{ person_form.instance.last_name }} Shawn-- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Using the form field values in templates

2010-01-17 Thread adrian_m
Hello people, How can I access the value of a form field in the template ? I'm having two different use cases : - display a field value as simple text (the field is not meant to be edited by the user, therefore i don't want to use a input field) - use the field value for generating a link (