Jon Cox
Jon Cox

Reputation: 10922

jQueryUI autocomplete implementing search page replacement

On the (now old) jQuery autocomplete plugin there was the functionality that if the user clicked on or pressed enter to select an autocompletion, they were taken to that page - i.e. they skipped the search results page. Details here: http://docs.jquery.com/Plugins/autocomplete#Search_Page_Replacement

I'm using the new jQueryUI Autocomplete Widget, and am really struggling trying to figure out how to implement this feature.

Are there any jQuery gurus out there who know how?

Upvotes: 0

Views: 396

Answers (1)

Kieran Andrews
Kieran Andrews

Reputation: 5885

$( ".selector" ).autocomplete({
  select: function(event, ui) { 
     location.href = ui.item.url;
  }
});

http://jsbin.com/oliqu3/edit

Upvotes: 2

Related Questions