I am using jQuery Autocomplete plugin 1.1 by Joern Zaefferer.
Everything works fine on the code.
Documentation however is scarce. I am needing someone to help me find out how to turn the autocomplete ‘on’ or ‘off’ using an href link.
It seems the unautocomplete() function should work somehow to disable it but not sure how to call it correctly.
I use this to activate it when page is loaded:
$().ready(function() {
$("#term").autocomplete("autocomplete.php", {
width: 260,
matchContains: true,
noCache: true,
minChars: <?php echo $auto_char; ?>,
selectFirst: false
});
});
What I have done is added a “hide suggestions” link to the end of the returned results and am trying to disable the autocomplete when the user clicks it.
Assuming your HTML look like this:
You can call
$.unautocompletethis way to disable the#termelement.Or, I guess you can use this to disable all autocompletes:
Also, you may want to upgrade to a more recent version of the AutoComplete plugin.