HTML表单文字输入建议框 [英] HTML Form text input suggestions box

查看:486
本文介绍了HTML表单文字输入建议框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图修改我的一个表单中的一个文本输入框。我希望建议在用户输入时弹出。基本上,我想仿效堆栈溢出中问题页面上的标签框,但显然有不同的数据。我会如何去做这件事?

对于上下文来说,这是针对大学的一家俱乐部,我试图让成员键入他们的专业,并在他们打字时提出建议。

感谢,
Ross

解决方案

您可以使用的自动完成插件:
http://docs.jquery.com/Plugins/autocomplete



这取决于什么样的语言/平台/等。你也在使用。我主要是.NET开发人员,我使用了以下内容:


  1. 用于存储数据的SQL Server

  2. Web应用程序的Web表单或MVC

  3. 用于检索和格式化建议的ashx处理程序
  4. 上面的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:

  1. SQL Server for storing data
  2. Web Forms or MVC for the web app
  3. An ashx handler to retrieve and format the suggestions
  4. jQuery plugin above to render the results returned from the ashx underneath an input box

Hope this helps!

这篇关于HTML表单文字输入建议框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆