它不采用来自列表的值(带有自动完成功能),它只采用我写入文本框中的值。如果有人给我任何技巧,我会很高兴。
提前致谢,
$(function () {
var availableTags = [
"Mustafa Basyurt",
"Hakan Öz",
"Ahmet Taşkın",
"Burhan Top"
];
$("#<%=txtMembers.ClientID%>").autocomplete({
source: availableTags,
messages: {
noResults: '',
results: function () { }
},
select: function () {
$("#members").append("<span class='button blue' id='" + ItemNo + "' style='font-size: 16px; margin-left:0px'>" + $("#<%=txtMembers.ClientID%>").val() + "<a onclick='RemoveItem(this);'><img src='../../Style/images/icons/close.png' style='vertical-align:central; margin-top:2px' /></a> </span> ");
}
});
});
HTML:
<asp:TextBox ID="txtMembers" runat="server" Width="90%" BackColor="LightBlue" Height="20px"></asp:TextBox>
<div id="members"></div>