Current behaivor: After adding forms, deleting forms works until totalForms.val() > minForms.val().
showDeleteLinks() returns the correct value for when the delete links should appear. But if one of the INITIAL_FORMS is deleted, then the form is not deleted but hided, and the TOTAL_FORMS value is not updated. For example, if you set in Django min_num=1 and extra=0, then click 'add another', then delete the first of the two forms by clicking 'remove'. You end up with one row for input, but the 'remove' link is still there and allows to remove the last form too. So technically, you can remove all forms.
Expected behaivor: After reaching min_num, remove link should disappear.
But this introduce another bug.
Now if you try to remove the last form it would not be removed. Since originally form-TOTAL_FORMS counter is not reduced when for form delete is "on".
Current behaivor: After adding forms, deleting forms works until
totalForms.val() > minForms.val()
.showDeleteLinks()
returns the correct value for when the delete links should appear. But if one of the INITIAL_FORMS is deleted, then the form is not deleted but hided, and theTOTAL_FORMS
value is not updated. For example, if you set in Djangomin_num=1
andextra=0
, then click 'add another', then delete the first of the two forms by clicking 'remove'. You end up with one row for input, but the 'remove' link is still there and allows to remove the last form too. So technically, you can remove all forms.Expected behaivor: After reaching
min_num
, remove link should disappear.