jQuery Autocomplete: Event-select

后端 未结 2 1226
花落未央
花落未央 2021-02-02 10:11

I am trying to submit a form when an item is selected from the menu. I set class on the search form and I am using the event select for it which is found here: http://docs.jquer

2条回答
  •  情书的邮戳
    2021-02-02 10:33

    Hehe. Quite tricky this one, but incredibly simple to solve. Just delay the function 500 milliseconds, after the select event. It works perfectly. JOB DONE!! :)

    $("#searchform-input").autocomplete({
    select: function (a, b) {
        setTimeout(submit,500);
    }});
    

提交回复
热议问题