I'm trying to create a simple autocomplete input on a form I'm creating. Everything is working out great so far (the autocomplete is populating, the form works, etc), but I need to add in a way to close the autocomplete popup without selecting one of the terms in it. The autocomplete on the Google homepage is pretty much what I'm looking to have, a simple "Close" button/link that the user can click on without choosing one of the options.
Also, I don't want to add in a plugin, I'm really hoping to either find a setting that creates this automatically or find a simple way to add in this button through the Autocomplete DOM. Any thoughts?
Here is the code so far:
- $(document).ready(function() {
$("#Job_Visible").autocomplete({
source: "/index.cfm?FuseAction=AutoSuggest.JobTitles",
minLength: 3,
delay: 0
}).blur(function() {
$("#Job_Visible").autocomplete("close");
});
});