开发者

jQuery autocomplete on various data in single textbox

开发者 https://www.devze.com 2023-01-30 06:56 出处:网络
I have a textbox on which i want to bind multiple autocomplete JSON da开发者_开发知识库ta. For example, if I type

I have a textbox on which i want to bind multiple autocomplete JSON da开发者_开发知识库ta. For example, if I type

Name:

the autocomplete data should display names of employees and after a delimeter (, OR ;) suppose I type

Department:

the autocomplete data should display options to select departments, so on and so forth. Any guidance as to how can this be achieved?


I like this jQuery autocomplete plugin. One of its features is, it can get its autocomplete data over AJAX. So it'll call your script (PHP or what have you) on the server and pass the current contents of the autocomplete text field as a parameter. From there, you can do whatever you want. Pick apart their text at whatever delimiter you choose, return whatever are sensible options for autocompletion, etc, etc. It's all in your hands at that point.

0

精彩评论

暂无评论...
验证码 换一张
取 消