更新时间:2023-12-05 17:49:40
(document).ready(function(){
SearchText();
});
函数SearchText(){
(document).ready(function () { SearchText(); }); function SearchText() {
(。autosuggest)。autocomplete({
minLength:3,
source:function(request,response) {
(".autosuggest").autocomplete({ minLength: 3, source: function (request, response) {
.ajax({
type:POST,
contentType:application / json; charset = utf-8,
url: ServiceHub.aspx / GetAutoCompleteData,
data:{'companyname':'+ document.getElementById('txtSearch')。value +'},
dataType:json,
成功:函数(数据){
响应(data.d);
},
错误:函数(结果){
alert(错误:自动完成(CardName)中的无效SQL查询);
}
});
}
});
}
.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "ServiceHub.aspx/GetAutoCompleteData", data: "{'companyname':'" + document.getElementById('txtSearch').value + "'}", dataType: "json", success: function (data) { response(data.d); }, error: function (result) { alert("Error: Invalid SQL Query in AutoComplete (CardName)"); } }); } }); }
自动完成工作正常,但我无法访问所选的或保持价值坐在文本框中。
The autocomplete works fine, but I can't access the selected or held value sitting in the text box.