选择标签时,标签添加正确,但输入框中附加了文本[object Object]。(见下图)
我正在使用 Bootstrap 3、JQuery、Bootstrap3-typeahead 和 bootstrap-tagsinput(所有最新版本)
表单位于模式窗口中。
这是代码:
jQuery('#banner_geo_locations').tagsinput({
itemValue: 'value',
itemText: 'text',
typeahead: {
displayKey: 'text',
source: function (query) {
return jQuery.get("http://dev.marijuanaweeklycoupons.com/?action=ajax|cityStateSsearchTags&PageSpeed=off&q=" + query);
}
}
});
阿贾克斯看起来像:
[{"value":"2908762","text":"Dixon Corner, AL"},
{"value":"2956030","text":"Dixon Corner, ME"},
{"value":"3008251","text":"Dixon Corner, PA"},
{"value":"2931983","text":"Dixon Crossroads, GA"},
{"value":"3017149","text":"Dixon Crossroads, SC"},
{"value":"2959449","text":"Dixon Estates, MD"},
{"value":"2959450","text":"Dixon Hill, MD"},
{"value":"2993971","text":"Dixon Landing, NC"},
{"value":"2908763","text":"Dixon Shop, AL"},
{"value":"2938722","text":"Dixon Springs, IL"}]
在小提琴中看到它