You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at your example, it appears you forgot to specify a unique formCssClass for each formset. The documentation states:
Internally, all forms with the same [formCssClass] are assumed to
belong to the same formset. If you have multiple formsets on a single
HTML page, you MUST provide unique class names for each formset. If
you don't provide a value, this defaults to "dynamic-form".
The $(...).selector property is an elegant way to identify which forms belong to a formset (and would eliminate the need for unique formCssClasses). However, there seem to be restrictions on when it can be used reliably, which makes me think perhaps, that being explicit is better.
I'm marking this Invalid, since multiple formsets work fine, so long as each one has a unique formCssClass (as per the documentation). Thanks for taking the time to contribute anyway :)
From 4ro...@gmail.com on February 02, 2011 14:14:18
What steps will reproduce the problem? 1. Add few formsets in a page, for instance
{{ formset1.management_form }}
{% for form in formset1.forms %}
{{ form }}
{% endfor %} <script type="text/javascript"> $('.form1').formset({ prefix: '{{ formset1.prefix }}', addText: '+', deleteText: '-', }) </script>
{{ formset2.management_form }}
{% for form in formset2.forms %}
{{ form }}
{% endfor %} <script type="text/javascript"> $('.form2').formset({ prefix: '{{ formset2.prefix }}', addText: '+', deleteText: '-', }) </script>
Little patch for fix this bug.
Attachment: delete.patch
Original issue: http://code.google.com/p/django-dynamic-formset/issues/detail?id=23
The text was updated successfully, but these errors were encountered: