Download & Extend

Allow Field Exclusion for ctools-auto-submit-full-form

Project:Chaos tool suite (ctools)
Version:7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

Comments

#1

Status:active» needs review

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.

AttachmentSizeStatusTest resultOperations
1735254-exclude-form-element-autosubmit_with_docs.patch1.59 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1735254-exclude-form-element-autosubmit_with_docs.patch. Unable to apply patch. See the log in the details link for more information.View details

#2

Status:needs review» needs work

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

#3

Here is a re-roll against the latest dev.

AttachmentSizeStatusTest resultOperations
1735254-exclude-form-element-autosubmit_with_docs_0.patch1.53 KBIdlePASSED: [[SimpleTest]]: [MySQL] 60 pass(es).View details

#4

Status:needs work» needs review

#5

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

#6

Status:reviewed & tested by the community» fixed

Committed and pushed.

#7

Status:fixed» closed (fixed)

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

#8

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);
         }
       });