JQuery ( LINK) autocomplete has the ability to disable it, which looks like this:
$(input).autocomplete({ disabled: true });
I would like it to be disabled because its default settings are to respond to keystrokes. I use keydown function much better. So I turned it off, and I wrote a function with this way:
timer = 0;
function func (){
var val = $(input).val();
$(input).autocomplete('search', val);
}
$(input).live('keydown', function(){
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(func, 50000);
$(input).autocomplete( "enable" );
});
This does not work ... means that it does not search after 50,000 ms, but instead it does the default setting using keyup. What should i change?
Youss source
share