Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)
        }
});
like image 406
LordCommander Avatar asked Sep 05 '25 01:09

LordCommander


1 Answers

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

Source :"getTags"

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

like image 151
Naga Sai A Avatar answered Sep 07 '25 13:09

Naga Sai A