Is it possible with jQuery Auto-complete, to make it so that if there are ‘source:’ values available, but they don’t match what you are typing, then just show all the sources at once?
IE, given the following code, if I type in “pineapple”, how do you show all the programming languages instead of none of them?
<script>
$(function() {
var availableTags = [
"JavaScript",
"Perl",
"PHP",
"Python",
"Ruby"
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
</script>
<input type="text" id="tags" />
Use the
sourceproperty with a custom function. The custom function shown below mimics autocomplete original behavior, searching for the typed text as substring inside available tags. If no match is found, all available tags are returned.demo here