From the course: Django: Forms

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Formsets: Multiple forms on a page

Formsets: Multiple forms on a page

From the course: Django: Forms

Start my 1-month free trial

Formsets: Multiple forms on a page

- [Instructor] We've gone very in-depth with forms, but I'm here to take you to the next level by talking about something called form sets. Form sets allow you to take one form and repeat it over and over, so in our case, people could order multiple pizzas at once. So, form sets take some work. We're going to have to move step by step in order to get this live, but let's go ahead and start here inside of our order.html. And we want to be able to send people over to our order page to order multiple pizzas, so let's go ahead and put in a few BR tags so that there's enough space in between the above order form and what we're creating down below. Then what we want to have is ask the user something like, want more than one pizza, question mark. Then, what we're going to do is provide a new form. So, this form, all it's going to do is take us to the multiple pizza order page, but it's going to show how many pizzas that they want. So, with this form, we'll create an action, and this action…

Contents