elo80ka / django-dynamic-formset

A jQuery plugin that allows you dynamically add new forms to a rendered django formset.
677 stars 311 forks source link

When created inside display:none div and shown later the delete buttons are not available #136

Open owenfi opened 7 years ago

owenfi commented 7 years ago

I have a form that dynamically shows a section to fill in a bunch of names (or whatever) and it only shows up if a certain flow is taken in the earlier part of the form.

To show the name section I'm using:

document.getElementById('attending').style.display = '';

while it started as display: none;

This seems to cause an issue with the add/delete buttons from this project. If I move my formset out of the hidden section it works as expected. If I put it back inside the add button appears and works, but I can't delete rows :(

owenfi commented 7 years ago

PR Here to resolve: https://github.com/elo80ka/django-dynamic-formset/pull/137