diff --git a/misc/autocomplete.js b/misc/autocomplete.js index 5e85be4..2bbaaa3 100644 --- a/misc/autocomplete.js +++ b/misc/autocomplete.js @@ -112,6 +112,19 @@ Drupal.jsAC.prototype.onkeyup = function (input, e) { */ Drupal.jsAC.prototype.select = function (node) { this.input.value = $(node).data('autocompleteValue'); + if(jQuery(this.input.form).hasClass('ajax-processed')) { + var options = { + dataType : 'script', + url : Drupal.settings.basePath + 'system/ajax', + type : 'POST', + data : {_triggering_element_name : "op", _triggering_element_value : ''} + }; + $(this.input.form).ajaxSubmit(options); + } else { + this.input.form.submit(); + } + //return false to prevent normal browser submit and page navigation + return false; }; /**