autocomplete (ajax) allows edits ok.

but does not save with text with allowed values autocomplete in IE and Chrome. There are no error messages that I see, it just doesn't save (or show the spiny blue wheel) when clicking outside the autocomplete field.

autocomplete fields (ajax setting) are saving ok in Firefox and Safari.

What can I do to fix this? Is there something someone can point me to to get me started in the right direction?

I have two autocomplete fields I'm using edit in place for: one is just a text field with my list of allowed values (that have keys), the other is the province part of a cck location field from the location module. Province uses autocomplete.

Comments

YesCT’s picture

#364287-116: State / Province drop down and Full State name in address field might be a work around for location, changing autocomplete to a dropdown select

YesCT’s picture

Initially it seems that that patch to change the state province to drop down worked to get location cck to save in IE with editablefields. It's a work around, not a fix for editablefields.

valllabh’s picture

vegantriathlete’s picture

I can verify that I am seeing the same problem. I've got a nodereference field that uses autocomplete.

In FireFox, the autocomplete fills in and saves. In IE and Chrome the autocomplete fills in but does not save. This behavior is true in the Windows OS and in Ubuntu (Obviously I did not test IE in Ubuntu, just Chromium).

Makku01’s picture

I got the same problem, is there a workaround? Can anyone confirm that the method from#3 works?

tbroberg’s picture

Version: 6.x-3.x-dev » 6.x-2.x-dev

I spent a little time poking at this in the debugger in 6.x-2.x. Under chrome, the jQuery framework is never calling the onchange function.

If I call $(this).change() immediately after registering the onchange function, it gets there, but it never does when the actual change happens.

The error console is clean both under Chrome and Firefox.

I'm not sure if somebody else is coming along and registering for the change, or if the this reference is getting fouled up, or what.

I also tried switching to 6.x-3.x-dev at which point the fields did not display at all.

Is anybody still maintaining 6.x-*?

tbroberg’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
dags’s picture

Unfortunately, no one is maintaing the 6.x branch.

tbroberg’s picture

I finally fixed the darned thing based on this comment:

He suggests tweaking your module. I went ahead and hacked misc/autocomplete.js

/**                                                                                                                                                                                            
 * Hides the autocomplete suggestions                                                                                                                                                          
 */
Drupal.jsAC.prototype.hidePopup = function (keycode) {
  // Select item if the right key or mousebutton was pressed                                                                                                                                   
  if (this.selected && ((keycode && keycode != 46 && keycode != 8 && keycode != 27) || !keycode)) {
    this.input.value = this.selected.autocompleteValue;
  }
  // Hide popup                                                                                                                                                                                
  var popup = this.popup;
  if (popup) {
    this.popup = null;
    $(popup).fadeOut('fast', function() { $(popup).remove(); });
  }
  this.selected = false;
  // https://www.drupal.org/node/787610                                                                                                                                                        
  // Force a change event                                                                                                                                                                      
  $(this.input).change(); // <----- Fix here
};
joelpittet’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing this to triage the queue. Feel free to comment if you'd like this to be re-opened, though currently there is nobody supporting the 6.x branch.