From 0e002f6a9112a67081bceb6a93f858e61a5dcd08 Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 15 Nov 2012 19:05:32 +0530 Subject: [PATCH] fix popup form filling in wrong select2 bug --- itf/static/js/jquery.formset.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/itf/static/js/jquery.formset.js b/itf/static/js/jquery.formset.js index eacee96..428f0e4 100644 --- a/itf/static/js/jquery.formset.js +++ b/itf/static/js/jquery.formset.js @@ -74,9 +74,10 @@ } $addBtn.click(function() { var nextIndex = parseInt($('#id_' + options.prefix + '-TOTAL_FORMS').val()); + alert(nextIndex); var row = $('.' + options.formCssClass + ' fieldset:first').clone().get(0); $(row).removeAttr('id').insertAfter($('.' + options.formCssClass + ' fieldset:last')); - $(row).find('input,select,textarea,label').each(function() { + $(row).find('input,select,textarea,label,a').each(function() { updateElementIndex(this, options.prefix, nextIndex); // If this is a checkbox or radiobutton, set uncheck it. // Fix for Issue 1, reported by Wilson.Andrew.J: