diff --git a/js/ajax_view.js b/js/ajax_view.js index 7d54c67..d13f04a 100644 --- a/js/ajax_view.js +++ b/js/ajax_view.js @@ -57,7 +57,7 @@ Drupal.views.ajaxView = function(settings) { this.settings = settings; // Add the ajax to exposed forms. - this.$exposed_form = this.$view.children('.view-filters').children('form'); + this.$exposed_form = $('form.view-filter-dom-id-' + settings.view_dom_id); this.$exposed_form.once(jQuery.proxy(this.attachExposedFormAjax, this)); // Add the ajax to pagers. diff --git a/views.module b/views.module index 9cdcfb5..c4224f6 100644 --- a/views.module +++ b/views.module @@ -2036,6 +2036,9 @@ function views_exposed_form($form, &$form_state) { // If using AJAX, we need the form plugin. if ($view->use_ajax) { drupal_add_library('system', 'jquery.form'); + + // Add dom_id class to the form for ajax selection purposes. + $form['#attributes']['class'][] = 'view-filter-dom-id-' . $view->dom_id; } ctools_include('dependent');