0
jQuery(document).ready(function(){
$('#location_search').autocomplete(
{
source:'suggest_location.php',
minLength:1});
});
它返回JSON數據:
[
{
"label" : "EB\u0130 Konukevi",
"value" : "EB\u0130 Konukevi, 32.791, 39.888",
"hor" : "32.791",
"ver" : "39.888"
},
{
"label" : "EB\u0130 Gretwes",
"value" : "EB\u0130 Gretwes, 32.491, 39.488",
"hor" : "32.491",
"ver" : "39.488"
}
]
當我選擇lacations之一,它填充location_search領域。
當我選擇一個位置時,我將如何用hor和ver填充隱藏文本輸入(帶有id的ver和hor)?
其自動完成插件您使用的? – Derek 2013-02-20 19:17:09
你總是可以設置一個事件處理程序 '開放式' 事件: $( '#location_search')自動完成({ 來源: 'suggest_location.php', 的minLength:1 開:函數(事件,UI) {} }); – Derek 2013-02-20 19:19:34