Using Autocomplete: Any way to ignore "space"
I have a long list of web links, and a search field that allows users to search them. The user starts typing into a search field, and the form uses jquery ui autocomplete to instantly display the list of matching links. They can click a result and instantly be taken to the site.
The problem is, if they type a "space"
first, it renders every single link whose label contains a space in it.
Is there any way to construct this so spaces entered are ignored?
Example code:
$(function() {
var availableTags = [
$( "#tags" ).autocomplete({
source: availableTags,
select:function(e,ui) {
location.href = ui.item.the_link;
// console.log(ui.item.the_link);
}
});
});
Thanks!!