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.

Files: 
CommentFileSizeAuthor
#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

Comments

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.
<button><h1>Click</h1></button>
instead of:
<input type="button" />
--http://stackoverflow.com/questions/469059/button-vs-input-type-button-which-to-use

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

WELL,HELPsFUL

richmac’s picture

Assigned:Unassigned» richmac
richmac’s picture

Assigned:richmac» Unassigned
Status:Patch (to be ported)» Needs review
FileSize
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
FileSize
606 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 81,126 pass(es). View

reroll

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) {
to
$('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form).each(function (index) {
heykarthikwithu’s picture

re-roll

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.