0
你可以請幫助我如何獲得自動完成下拉選定的項目的價值?我能夠填充數據,我想單獨獲取所選項目的值。以下是我正在使用的片段。自動完成與ASP.Net的JQuery
$(document).ready(function() {
$("#txtTest").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Webservice.asmx/GetNames",
data: "{'prefix':'" + request.term + "'}",
dataType: "json",
async: true,
success: function (data){
response($.map(data, function(item)
{ return item ; }));
},
error: function (result) {
alert("Due to unexpected errors we were unable to load data");
}
});
},
minLength:2
});
});
感謝
選定的值必須作爲客戶端的一部分而不使用.aspx – pal