From d5ce7f5281373044b8e1df6d95287270c0b33145 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 7 Apr 2010 17:30:43 +0000 Subject: - Patch #384992 by effulgentsia, sun: drupal_html_id() does not work correctly in AJAX context with multiple forms on page. --- misc/ajax.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'misc/ajax.js') diff --git a/misc/ajax.js b/misc/ajax.js index f8e3ee6d3..1d6c8295d 100644 --- a/misc/ajax.js +++ b/misc/ajax.js @@ -200,6 +200,12 @@ Drupal.ajax.prototype.beforeSubmit = function (form_values, element, options) { // Disable the element that received the change. $(this.element).addClass('progress-disabled').attr('disabled', true); + // Prevent duplicate HTML ids in the returned markup. + // @see drupal_html_id() + $('[id]').each(function () { + form_values.push({ name: 'ajax_html_ids[]', value: this.id }); + }); + // Insert progressbar or throbber. if (this.progress.type == 'bar') { var progressBar = new Drupal.progressBar('ajax-progress-' + this.element.id, eval(this.progress.update_callback), this.progress.method, eval(this.progress.error_callback)); -- cgit v1.2.3