Is it possible to hide the submit button on single checkboxes. It woulb be awesome in combination with the Fancy Checkbox Module.

Comments

kristen pol’s picture

Yeah, I find it a bit odd that the other non-checkbox fields all do an auto-update (e.g. add text and go out of the field and the text gets updated via ajax). Hope this gets in ;) Wish I had time to look at it.

Zorga Lina’s picture

Well, a general issue w/Ajax and checkbox event handling is posted here: http://drupal.org/node/556438#comment-form
But that isn't just w/in EditableFields. I am using checkboxes in a View, selecting the Editable formatter which then adds a 'Save' button. I would like a checkbox where checkchanged event would trigger a save of the field value/node. I don't want to 'hide' the Save button, I would like to dispense w/it.

Zorga Lina’s picture

I was trying to use the #ajax 'trigger_as' to no avail; in the end, I simply modified the jQuery (editablefields.js) to include the input type 'checkbox', where the submit button will be hidden, and the checkbox 'click' triggers submit.
HTH someone else! I feel that this is a good approach as stylistically, that is how js/jQuery is meant to be used within Drupal.

reevo’s picture

Have found myself applying the same fix for this issue a few times, attaching a patch

guschilds’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new963 bytes

Attached is a patch similar to #4 that only deals with checkboxes. #4 checks for more than 1 radio button and improperly assumes that means there is only one editable field.

apotek’s picture

Review:

From a style perspective, aren't we supposed to put spaces in JS function calls between params, ie:

Not this:
+ $this.find('input[type=text],input[type=checkbox],textarea,select').change(function() {

but this:
+ $this.find('input[type=text], input[type=checkbox], textarea, select').change(function() {

Testing:

This patch has been working nicely for us in production for well over a year. If the above style comment is a non-blocker I don't see any reason to not move this into the 7.x mainline of this project.

apotek’s picture

Status: Needs review » Reviewed & tested by the community

Forgot to change status.

joelpittet’s picture

Status: Reviewed & tested by the community » Closed (outdated)

Looks like this has been committed or is much different.