使用JavaScript在ASP中展开的下拉菜单 [英] Expandable dropdown in ASP using javascript
问题描述
我有一个名称文本框,当我在文本框中输入"bo"时出现一个下拉列表,然后从数据库中填充的下拉列表(sqlserver satabase,其中名称存储在一个表中)显示值bob
鲍比
骨
现在我的要求在下面给出.
我希望下拉列表中的名称会自动扩展以显示我在文本框中输入的所有匹配项,例如如果我仅在文本框中输入"bo",但仅显示第一个bob(但是db中存在3),除非用户实际单击了下拉菜单,所以他们有时会认为这是唯一匹配且不匹配的名称.不必再点击以查看是否还有其他内容.
我想在文本框中或在下拉菜单中输入bo时显示3个匹配项,而不是一个.
谢谢&问候
Care Career
I have one textbox for name,and one dropdown when I enter ''bo'' in textbox then dropdown which fills from database (sqlserver satabase wherein names are stored in one table) displays values bob
bobby
bony
Now my requirement is given below.
I want names in drop-down which will expand automatically to show all my matches which I have entered in the textbox e.g. If I am entering just ‘bo’ in the textbox but only the first bob is shown(however 3 exists in db) unless the user actually clicks the drop-down, so they sometimes assume that that is the only name that matches and don’t bother clicking to see if there are others.
I want when I enter bo in textbox or in dropdown then 3 matches will display rather than one.
Thanks & Regards
Care Career
推荐答案
您可以使用AJAX自动完成功能.
尝试以下示例:
http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/autocomplete/autocomplete.aspx [ ^ ]
http://gabewarren.wordpress.com/2007/11/22/aspnet -ajax-autocomplete-that-works/ [
You can use AJAX auto-complete.
Try these samples:
http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/autocomplete/autocomplete.aspx[^]
http://gabewarren.wordpress.com/2007/11/22/aspnet-ajax-autocomplete-that-works/[^]
hope it helps :)
您好,我希望在经典ASP中而不是在ASP.net中使用.请让我知道该怎么做?
谢谢&问候
Care Career
Hi, I want this in classic ASP rather than ASP.net. Please let me know how to do this?
Thanks & Regards
Care Career
这篇关于使用JavaScript在ASP中展开的下拉菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!