0

I am fairly new to Django and I am a bit confused about how to make forms work. I am able to make a single form based on a model I have, but how can I make 3 forms where the second form is generated based on the first form's inputs and the third form is based on the 2nd form's inputs?

For example:

First form: Input your location (city, state, country) Second form (generated after the first form completed): If country X, then exclude A field in the second form or if the country in the previous form was Y, then exclude B field in the second form. Third form: similar idea as second form.

Lastly, how do I prevent any database commits until all 3 forms are completed?

Thanks for any inputs!

Bob L
  • 111
  • 4
  • What are you looking for is a multiple steps form. There are already similar questions with answers: http://stackoverflow.com/questions/14901680/how-to-do-a-multi-step-form-in-django – cezar May 12 '17 at 17:10
  • Will the user _submit_ a form before proceeding to the next one? Or are all three forms on the same page? – John Gordon May 12 '17 at 17:11
  • multi-step form is exactly what I was looking for! thanks :) – Bob L May 12 '17 at 17:16

0 Answers0