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

↘锁芯ラ 提交于 2019-12-01 09:08:09
tim peterson

Andrew was correct, see the fiddle he mentioned. If you switch the part with "ui.item" to "ui.item.value" the select: function() now works perfectly.

Desty Nova

Yes it works

Except if you expect to get the value in your server-side script in the page called by action...

For now, no way to find why auto-submit of the form after selection by mouse or by keyboard, and the $(event.target).val(ui.item.value) line, don't deliver the value in $_POST array

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!