jquery.autocomplete.js 如何只实现自动提示,不实现自动补全功能?要写什么参数呢?
2个回答
2014-05-19
展开全部
<script type="text/javascript">
var option = {
max: 10,
width: 405,
minChars: 1,
autoFill: false,
scroll: false,
matchContains: true,
delay: 100,
selectFirst: false,
formatItem: function(row, rowNum, rowCount, searchItem) {
return row.Title;
},
formatMatch: function(row, rowNum, rowCount) {
return row.Title;
},
formatResult: function(row, rowNum, rowCount) {
return row.Title;
}
};
function initAutoComplete(data) { $("#search").autocomplete(data, option) };
$("#search").keyup(function() {
if ($("#search").val() == "") {
}
else {
$.getJSON("/ashx/txtQuestion.ashx?time=" + Date(), { Name: $.trim($("#search").val()) }, initAutoComplete);
}
});
</script>
var option = {
max: 10,
width: 405,
minChars: 1,
autoFill: false,
scroll: false,
matchContains: true,
delay: 100,
selectFirst: false,
formatItem: function(row, rowNum, rowCount, searchItem) {
return row.Title;
},
formatMatch: function(row, rowNum, rowCount) {
return row.Title;
},
formatResult: function(row, rowNum, rowCount) {
return row.Title;
}
};
function initAutoComplete(data) { $("#search").autocomplete(data, option) };
$("#search").keyup(function() {
if ($("#search").val() == "") {
}
else {
$.getJSON("/ashx/txtQuestion.ashx?time=" + Date(), { Name: $.trim($("#search").val()) }, initAutoComplete);
}
});
</script>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2019-03-25
展开全部
autoFill: false, //自动填充,及默认把符合要求的值填入文本框中;默认false
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询