HTML表单文字输入建议框 [英] HTML Form text input suggestions box
问题描述
我试图修改我的一个表单中的一个文本输入框。我希望建议在用户输入时弹出。基本上,我想仿效堆栈溢出中问题页面上的标签框,但显然有不同的数据。我会如何去做这件事?
对于上下文来说,这是针对大学的一家俱乐部,我试图让成员键入他们的专业,并在他们打字时提出建议。
感谢,
Ross
您可以使用的自动完成插件:
http://docs.jquery.com/Plugins/autocomplete
这取决于什么样的语言/平台/等。你也在使用。我主要是.NET开发人员,我使用了以下内容:
- 用于存储数据的SQL Server
- Web应用程序的Web表单或MVC
- 用于检索和格式化建议的ashx处理程序
- 上面的jQuery插件用于呈现结果来自输入框下的ashx
希望这有助于您!
I am attempting to modify one of my text input boxes in a Form that I have. I would like suggestions to pop up as the user types. Basically, I would like to emulate the "Tags" box that is on the ask question pages here on stack overflow, but with different data as the suggestions obviously. How would I go about doing this?
For context, this is for a club at a college, and I am trying to allow members to type in their majors and as they type have a suggestions come up.
Thanks, Ross
jQuery has an autocomplete plugin that you could use: http://docs.jquery.com/Plugins/autocomplete
It depends on what kind of language/platform/etc. you are using as well. I am a primarily .NET developer and I've used the following:
- SQL Server for storing data
- Web Forms or MVC for the web app
- An ashx handler to retrieve and format the suggestions
- jQuery plugin above to render the results returned from the ashx underneath an input box
Hope this helps!
这篇关于HTML表单文字输入建议框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!