Drupal Autocomplete Auto Submit


/ Published in: jQuery
Save to your folder(s)

This overrides a couple core Drupal functions in the autocomplete.js file. It changes the behavior of the autocomplete such that if a user selects an item from the autocomplete menu, it takes them directly to that node instead of just populating the search field.

Please note that this implementation is not totally bulletproof; as you can see, there is a little bit of jank happening in Drupal.jsAC.prototype.select to check if the item is numeric. This is because I had to pull the nid from the input field, not from the jQuery object as desired. If anyone has a solution for this, please leave a comment.

URL: http://iamtheunraveler.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.