简体   繁体   English

单个 select 下拉列表有过滤器使用 jquery

[英]single select drop down list have filter using jquery

 <td valign="middle">
     <select id="b1selection" 
             size="5"
             class="singleselect" 
             style="width: 370px">
         <asp:Repeater ID="rptDescription" runat="server">
             <ItemTemplate>
                 <option value='<%# Eval("ID") %>'
                         id='Description<%# Eval("ID") %>'>
                     <%# Eval("Title") %>
                 </option>
             </ItemTemplate>
         </asp:Repeater>
     </select>
     <input id="b1" name="b1" runat="server" 
            type="text" 
            class="text-input small-input" 
            style="display: none;"
            value="" />
 </td>

I want to have dropdown which bind from the database.我想要从数据库绑定的下拉列表。 It should have filter functionality such as if i write in textbox letter "S" then all item from "S" in drop down it will filter.它应该具有过滤功能,例如,如果我在文本框中输入字母“S”,那么下拉列表中“S”中的所有项目都会过滤。 so please help me out.所以请帮帮我。

I had tried with jquery with the help of this link我在此链接的帮助下尝试过使用 jquery

http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/#filter http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/#filter

but above link is for multiple select but i want single select.但上面的链接适用于多个 select 但我想要单个 select。

You can achieve this using Autocomplete textbox of Ajaxtoolkit.您可以使用 Ajaxtoolkit 的自动完成文本框来实现这一点。 and modified the css to give it a feel like dropdown box.并修改了 css 让它看起来像下拉框。 Try using this post .尝试使用这篇文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM