jQuery的自动完成功能类别选择标签和值 [英] jQuery Autocomplete Categories Select Label and Value
本文介绍了jQuery的自动完成功能类别选择标签和值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
试图让jQuery的自动完成与类别返回选定的值到搜索字段和值到一个单独的输入字段。
Trying to get the jQuery Autocomplete with categories to return the selected value to the search field and the value to a separate input field.
我已修改的数据,以具有值以及标签和类
I have modified the data to have a value as well as label and category.
请参阅 http://jsfiddle.net/chrisk/bM7ck/
但价值总是返回到搜索领域,而不是标签。
But the value is always returned to the search field instead of the label.
推荐答案
这就是当你提供一个标签和值jQuery用户界面自动完成的工作方式。如果你想返回到搜索字段标签,然后重命名值字段。
That's how the jquery ui autocomplete works when you supply both a label and a value. If you want the label returned to the search field, then rename the value field.
更新小提琴: http://jsfiddle.net/jensbits/bM7ck/3/
这篇关于jQuery的自动完成功能类别选择标签和值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文