Dynamically adding a form to a Django formset with Ajax

后端 未结 15 1904
不思量自难忘°
不思量自难忘° 2020-11-22 03:09

I want to automatically add new forms to a Django formset using Ajax, so that when the user clicks an \"add\" button it runs JavaScript that adds a new form (which is part o

15条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 03:34

    Check out the following solutions to dynamic django forms:

    http://code.google.com/p/django-dynamic-formset/

    https://github.com/javisantana/django-dinamyc-form/tree/master/frm

    They both make use of jQuery and are django-specific. The first seems a bit more polished and offers a download that comes w/demos which are excellent.

提交回复
热议问题