[英]Searchable Dropdown
在下面的代码中有一个下拉列表,其中包含各个国家/地区,我的目标是使下拉列表具有可编辑性和可搜索性。请帮我这样做。
码:
<label for='SelectCountry'>Choose a country:</label><br /><br />
<asp:DropDownList id='SelectCountry' name='SelectCountry' runat='server'
ClientIDMode='Static'>
<asp:ListItem Text='Afghanistan' Value='Afghanistan'></asp:ListItem>
<asp:ListItem Text='Albania' Value='Albania'></asp:ListItem>
<asp:ListItem Text='Algeria' Value='Algeria'></asp:ListItem>
<asp:ListItem Text='Bahrain' Value='Bahrain'></asp:ListItem>
<asp:ListItem Text='Bangladesh' Value='Bangladesh'></asp:ListItem>
<asp:ListItem Text='Barbados' Value='Barbados'></asp:ListItem>
<asp:ListItem Text='Cambodia' Value='Cambodia'></asp:ListItem>
<asp:ListItem Text='Cameroon' Value='Cameroon'></asp:ListItem>
<asp:ListItem Text='Canada' Value='Canada'></asp:ListItem>
</asp:DropDownList>
<br/>
<script type='text/javascript' >
$(function () {
$('#SelectCountry').ufd({ log: true });
});
</script>
</asp:Content>
您可以使用选择的jquery。
这是链接
Select2
是一个jquery插件,提供搜索和显示图像等功能,只需检查此链接: Select2 - DropDown
具有自动完成和过滤文本的可搜索下拉列表,只需浏览参考链接即可
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.