TTA wiki TTA wiki - 5 months ago 29
Javascript Question

jquery autocomplete delay not working

I have this in my autocomplete code.

Delay and minlength options are not working for me in Jquery Autocomplete

I tried putting sleep too in search function. even thats not working

What I am seeing on interface 1) "getTags" call getting executed even for 1/2 charactors and 2) Calls are being made instantaneously no delay whatsoever.

Please help

$('#autocomplete').autocomplete({
delay: 10000,
serviceUrl: "getTags",
minLength: 3,
search: function( event, ui ) {
sleepFor(2000);
console.log("Searching for",event)
}
});

Answer

Try replacing service URL with source and created codepen for reference -

Source :"getTags"

http://codepen.io/nagasai/pen/beBQRm