This patch allow for buttons (with type=submit) to trigger an ajax enabled exposed form, and is similar to the change in #1123300: Image button in block views with exposed filter breaks AJAX routine.

#24 1551534-23.patch795 bytesdevert
#21 1551534-21.patch672 bytesheykarthikwithu
#16 allow_a_button_in_an-1551534-16.patch606 bytesalansaviolobo
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 81,126 pass(es). View
#15 drupal8.views-module.1551534-15.patch638 bytesrichmac
PASSED: [[SimpleTest]]: [MySQL] 58,643 pass(es). View
allow-buttons-to-trigger-ajax.patch562 bytesbcn
PASSED: [[SimpleTest]]: [MySQL] 1,621 pass(es). View


bcn’s picture

Status: Active » Needs review

Status change since there is a patch to review.

dawehner’s picture

What is the difference between button in input, or why do you need this feature?

bcn’s picture

The general difference is a button can have html inside.
instead of:
<input type="button" />

I needed this because I was using a theme which used a element in the exposed filter of a view.

natted’s picture

I've tested this patch and use it also for the same reason as poster #3

Spry_Julia’s picture

I also tested it, because I ran into the issue described. Fixes issue for me as well.

zmove’s picture

+1 for this, especially with the HTML5 that is coming a support is very important.

cpliakas’s picture

Status: Needs review » Reviewed & tested by the community

+1, and I also confirm that the patch fixes the issue I ran into as well. This seems to have multiple testers with positive experiences and no discernable drawbacks, so marking as RTBC.

Jibus’s picture

+1, confirm that the patch works for me. Thanks !

dnewkerk’s picture

+1 also. Tested and confirmed this works perfectly. I ran into this issue when using the Twitter Bootstrap theme (which is HTML5-based), though it likely affects most/all of the various HTML5-based themes.

muka’s picture

+1 same issue on bootstrap theme, works for me

Lucasljj’s picture

dawehner’s picture

Project: Views » Drupal core
Version: 7.x-3.x-dev » 8.x-dev
Component: Code » views.module
Status: Reviewed & tested by the community » Patch (to be ported)

Great. Thanks for providing and testing the patch.

Committed to 7.x-3.x and marked as to be ported to 8.x

batabata’s picture


richmac’s picture

Assigned: Unassigned » richmac
richmac’s picture

Assigned: richmac » Unassigned
Status: Patch (to be ported) » Needs review
638 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,643 pass(es). View

The attached patch has been tested against a view created in 8.x-dev.

alansaviolobo’s picture

Issue summary: View changes
606 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 81,126 pass(es). View


DamienMcKenna’s picture

Does this patch need tests? It makes complete sense to me and still applies against HEAD. RTBC?

Lucasljj’s picture

Issue tags: +markup
mikefyfer’s picture


mikefyfer’s picture

Just to update this real quick, as it's still an issue. In a hurry, so no patch here, just the code.

as of Drupal 8.0.4

In core/modules/views/js/ajax_view.js - change

line 117
$('input[type=submit], input[type=image]', this.$exposed_form).each(function (index) {
$('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form).each(function (index) {
heykarthikwithu’s picture


Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

devert’s picture

This patch no longer seems to be able to be applied to latest Drupal 8.1.8.

devert’s picture

Version: 8.1.x-dev » 8.1.8
795 bytes

Re-roll so patch will work on Drupal 8.1.8

devert’s picture

Version: 8.1.8 » 8.1.x-dev