jQuery-UI Autocomplete submitting form onclick of item from dropdown list

后端 未结 3 880
死守一世寂寞
死守一世寂寞 2021-01-14 11:46

I\'m using the jQueryUI autocomplete() function and I can\'t figure out how to have my form submit when an item is selected.

I think the issue is with t

3条回答
  •  庸人自扰
    2021-01-14 12:05

    Yeah Alice is also right. You just need to add this line in your onclick function:

     $('#search_form').submit();
    

    where search_form is the id of your form.

提交回复
热议问题