开发者

single select drop down list have filter using jquery

开发者 https://www.devze.com 2023-03-11 09:09 出处:网络
<td valign=\"middle\"> <select id=\"b1selection\" size=\"5\" class=\"singleselect\" style=\"width: 370px\">
 <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. so please help me out.

I had tried with jquery with the help of this link

http://www.erichynds.com/examples/jquery-ui-multiselec开发者_Go百科t-widget/demos/#filter

but above link is for multiple select but i want single select.


You can achieve this using Autocomplete textbox of Ajaxtoolkit. and modified the css to give it a feel like dropdown box. Try using this post.


I recommend the jquery autocomplete plugin:

http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/

0

精彩评论

暂无评论...
验证码 换一张
取 消