diff --git a/django/contrib/admin/templates/admin/edit_inline/stacked.html b/django/contrib/admin/templates/admin/edit_inline/stacked.html index 3ef5976f93..08e8ca306d 100644 --- a/django/contrib/admin/templates/admin/edit_inline/stacked.html +++ b/django/contrib/admin/templates/admin/edit_inline/stacked.html @@ -27,14 +27,14 @@ var count = i + 1; $(this).html($(this).html().replace(/(#\d+)/g, "#" + count)); }); - } + }; var reinitDateTimeShortCuts = function() { // Reinitialize the calendar and clock widgets by force, yuck. if (typeof DateTimeShortcuts != "undefined") { $(".datetimeshortcuts").remove(); DateTimeShortcuts.init(); } - } + }; var updateSelectFilter = function() { // If any SelectFilter widgets were added, instantiate a new instance. if (typeof SelectFilter != "undefined"){ @@ -47,7 +47,7 @@ SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% static "admin/" %}"); }); } - } + }; var initPrepopulatedFields = function(row) { row.find('.prepopulated_field').each(function() { var field = $(this); @@ -55,13 +55,13 @@ var dependency_list = input.data('dependency_list') || []; var dependencies = []; $.each(dependency_list, function(i, field_name) { - dependencies.push('#' + row.find(field_name).find('input, select, textarea').attr('id')); + dependencies.push('#' + row.find('.form-row .field-' + field_name).find('input, select, textarea').attr('id')); }); if (dependencies.length) { input.prepopulate(dependencies, input.attr('maxlength')); } }); - } + }; $(rows).formset({ prefix: "{{ inline_admin_formset.formset.prefix }}", addText: "{% blocktrans with verbose_name=inline_admin_formset.opts.verbose_name|title %}Add another {{ verbose_name }}{% endblocktrans %}", diff --git a/django/contrib/admin/templates/admin/edit_inline/tabular.html b/django/contrib/admin/templates/admin/edit_inline/tabular.html index 8a6578f4d3..9e215afd92 100644 --- a/django/contrib/admin/templates/admin/edit_inline/tabular.html +++ b/django/contrib/admin/templates/admin/edit_inline/tabular.html @@ -22,7 +22,7 @@ {% if inline_admin_form.form.non_field_errors %}
@@ -103,7 +103,7 @@ var dependency_list = input.data('dependency_list') || []; var dependencies = []; $.each(dependency_list, function(i, field_name) { - dependencies.push('#' + row.find(field_name).find('input, select, textarea').attr('id')); + dependencies.push('#' + row.find('.field-' + field_name).find('input, select, textarea').attr('id')); }); if (dependencies.length) { input.prepopulate(dependencies, input.attr('maxlength')); diff --git a/django/contrib/admin/templates/admin/includes/fieldset.html b/django/contrib/admin/templates/admin/includes/fieldset.html index 0b71d501f9..c8d08c880f 100644 --- a/django/contrib/admin/templates/admin/includes/fieldset.html +++ b/django/contrib/admin/templates/admin/includes/fieldset.html @@ -7,7 +7,7 @@