I have the same question as: Limit results autocomplete jquery ui with slice function , been looking for a solution (other than hiding using CSS) for the past 2 hours or so.
I want to add this slice function, demo here: https://stackoverflow.com/a/7617637/1607449
$("#auto").autocomplete({
source: function(request, response) {
var results = $.ui.autocomplete.filter(myarray, request.term);
response(results.slice(0, 10));
}
});
And I would like it to work with the script in this example: http://jsfiddle.net/h5E6C/ (not my array/script but my setup is similar).
I'm looking for solutions to this question, so please don't respond with a suggestion to use PHP/SQL to filter the data before sending etc. Don't mean to be rude..
I can get either script to work independently of one another but not together :/