I am a big fan of the full form auto submission, but there are wierd edge cases where you want to exclude a certain form element. It would be nice to have that ability by adding a class to the form.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

populist’s picture

Status: Active » Needs review
FileSize
1.59 KB

Here is a patch to make that happen that excludes checking on the class "ctools-auto-submit-exclude". I also updated the documentation at the top of the .js file to reflect this.

Status: Needs review » Needs work

The last submitted patch, 1735254-exclude-form-element-autosubmit_with_docs.patch, failed testing.

populist’s picture

Here is a re-roll against the latest dev.

populist’s picture

Status: Needs work » Needs review
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

The feature request totally makes sense and it's implement pretty straighforward.

Additional i like the documentation

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

modestmoes’s picture

I am still having this problem with a checkbox that I am adding via hook_form_alter to a views_exposed_form

The solution I have found is:

diff --git a/sites/all/modules/ctools/js/auto-submit.js b/sites/all/modules/ctools/js/auto-submit.js
index 890dd1f..df69662 100644
--- a/sites/all/modules/ctools/js/auto-submit.js
+++ b/sites/all/modules/ctools/js/auto-submit.js
@@ -49,7 +49,7 @@ Drupal.behaviors.CToolsAutoSubmit = {
       .once('ctools-auto-submit')
       .change(function (e) {
         // don't trigger on text change for full-form
-        if ($(e.target).is(':not(:text, :submit)')) {
+        if ($(e.target).is(':not(:text, :submit, .ctools-auto-submit-exclude)')) {
           triggerSubmit.call(e.target.form);
         }
       });