日期:2014-05-17  浏览次数:20424 次

TextBox 填入内容会搜索展开提示 展开提示后必须选择内容 不选择内容自动清空
TextBox 填入内容会搜索展开提示  展开提示后必须选择内容 不选择内容自动清空

怎么想怎么有冲突,怎么实现不了

------解决方案--------------------
http://jqueryui.com/autocomplete/。用jquery控制一下就好了。
------解决方案--------------------
利用 jquery.autocomplete 来实现展开提示。

展开提示后必须选择内容 不选择内容自动清空
$.ajax({
type: "POST",
contentType: "application/json",
url: "AjaxPage.aspx/GetAllLocation",
data: "{}",
dataType: "json",
success: function (msg) {
var datas = eval('(' + msg.d + ')');
 //这里添加你的button点击事件里面判断是否必选内容,否则自动清空textbox
$("#btnClick").click(function(){
if($("#txtName").val()==""){alert('必选选择内容')}
};
}
}
});

------解决方案--------------------
AutoCompleteExtender 于Textbox结合
------解决方案--------------------
http://fineui.com/demo/#/demo/dropdownlist/dropdownlist_forceselection.aspx

fineUI下拉强制选择
------解决方案--------------------
传送门