|
@ -26,8 +26,9 @@ function deleteForm(prefix, btn) { |
|
|
if (total >= 1){ |
|
|
if (total >= 1){ |
|
|
btn.closest('tr').remove(); |
|
|
btn.closest('tr').remove(); |
|
|
var forms = $('.hodnoceni'); |
|
|
var forms = $('.hodnoceni'); |
|
|
$('#id_' + prefix + '-TOTAL_FORMS').val(forms.length); |
|
|
var formCount = forms.length - 1; // There is one extra such form hidden as template! |
|
|
for (var i=0, formCount=forms.length; i<formCount; i++) { |
|
|
$('#id_' + prefix + '-TOTAL_FORMS').val(formCount); |
|
|
|
|
|
for (var i=0; i<formCount; i++) { |
|
|
$(forms.get(i)).find(':input').each(function() { |
|
|
$(forms.get(i)).find(':input').each(function() { |
|
|
updateElementIndex(this, prefix, i); |
|
|
updateElementIndex(this, prefix, i); |
|
|
}); |
|
|
}); |
|
|