0

I'm looking to include the same form into a template multiple times. For example:

I have a form which allow the user to add a Url ( with its description and title) into my app. But I would like to put a "+" button which includes/prints the same form, so it will be unnecessary to refresh the page to add a new url. Basically, I just want to avoid the needing of refreshing the page to add multiple urls. It is actually possible with Django? Thank you very much in advance, and sorry for my english.

Alessandro
  • 643
  • 1
  • 7
  • 20
  • 2
    You are looking for a [django-formset]. Also, see this: http://stackoverflow.com/questions/501719/dynamically-adding-a-form-to-a-django-formset-with-ajax(https://docs.djangoproject.com/en/dev/topics/forms/formsets/) – karthikr Mar 11 '14 at 20:16
  • @karthikr: formsets are the right starting point indeed, but the OP will also need some javascript. – bruno desthuilliers Mar 11 '14 at 20:20
  • That is what the second link is. – karthikr Mar 11 '14 at 20:24
  • @karthikr Thank you for the help, but the link you gave me is down. – Alessandro Mar 11 '14 at 20:31
  • 1
    Sorry: http://stackoverflow.com/questions/501719/dynamically-adding-a-form-to-a-django-formset-with-ajax and the formset link: https://docs.djangoproject.com/en/dev/topics/forms/formsets/ – karthikr Mar 11 '14 at 20:37

0 Answers0