There are some scenarios when you click the dropdown button the page reloads. It only happens when you put your select control inside of a form tag.
To get rid of this problem use the following code.
Add return false at the end of click event.
.click(function () { // close if already visible if (input.autocomplete("widget").is(":visible")) { input.autocomplete("close"); return; } // pass empty string as value to search for, displaying all results input.autocomplete("search", ""); input.focus(); return false; });
thanks very much this really helped a lot!! :))
ReplyDelete