Here is the code I used to get the search-bar to auto-complete. The '#tags' are for the input id in the HTML, that corresponds to the search-bar. When you click in the search-bar, the function runs (below) and if what you have typed in the search bar matches any of those four, you can select the one you want. I only put four for testing purposes.
<script>
$(document).ready(function() {
$(function() {
var availableTags = [
"Kyle Anderson",
"Reggie Smith",
"Amy John",
"Bob Bobby",
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
});
</script>
^ will probably be messed up when this is published.. Sigh...
- Kyle
No comments:
Post a Comment