If you have an existing project, it's quite easy to add client-side support for adding and removing forms. I'll assume you've already created your formset. You can create formsets using any of the provided methods: both regular formsets (created with the ``formset_factory``) and inline formsets (created with the ``inlineformset_factory``) are supported. 1. First, copy ``jquery.formset.js`` to your ``MEDIA_ROOT``; don't forget to include the jQuery library too! 2. Include a reference to the script in your template; again, remember to reference the jQuery library, before including the script. 3. Render the formset as you would normally -- I usually use a table but you can use DIVs, Ps or whatever you desire. Let's use the example markup below:: <form id="myForm" method="post" action=""> <table border="0" cellpadding="0" cellspacing="0">
Comments
Post a Comment