首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

ASP.NET 依据TextBox输入的内容自动定位到ListBox中项

2012-08-26 
ASP.NET根据TextBox输入的内容自动定位到ListBox中项这个效果很简单,直接上代码table trtddiv styl

ASP.NET 根据TextBox输入的内容自动定位到ListBox中项

                这个效果很简单,直接上代码

<table> <tr>            <td>                <div style="margin-top: 0; text-align: right">                    定位商户(请输入商户名称):                    <asp:TextBox ID="txtLocateAllSeller" runat="server" onkeyup="OnTextChanged('txtLocateAllSeller','liboxAllSellers')"></asp:TextBox></div>            </td>            <td>            </td>            <td>                <div style="margin-top: 0; text-align: left">                    定位商户(请输入商户名称):                    <asp:TextBox ID="txtLocateSelectSeller" runat="server" onkeyup="OnTextChanged('txtLocateSelectSeller','selectSellers')"></asp:TextBox></div>            </td>        </tr></table>

这个js方法好处就是一个通用方法,只需要传入TextBox的ID和ListBox的ID即可。定位也相当于模糊查询。


3楼MrChen904天前 16:16
我浮躁了 - - 不好意思 ,是好东西。
2楼wangqiuyun4天前 16:00
好东东,顶起
1楼Chinajiyong4天前 14:55
回复MrChen90n可以的,仔细看看是不是文本框ID和listBoxID是否正确,注意有单引号

热点排行