views:

136

answers:

1

Hello! I have a situation where we are trying to autofill some form data on the second page of a signup and I was wondering if there's a way to bypass the entire form validation when we pass in only a couple of fields?

so we have something like

form = NewForm(request.POST)

Where request.POST only contains some of the fields in NewForm(). So the page loads and there is feedback about how some fields are not filled in yet.

This all happens from the GET request of the second page.

Is there a way to do something like...

form = NewForm(request.POST, validate=False) 
+3  A: 

If you're passing in initial values, you should use the initial parameter, not data (ie the first positional argument). This does not trigger validation.

form = NewForm(initial=dict_of_field_values)
Daniel Roseman
Awesome! Thanks! How did I miss that in the documentation!
Thomas Schultz