Search code examples
formshtmlinputautosuggest

HTML Form text input suggestions box


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.


Solution

  • jQuery has an autocomplete plugin that you could use.

    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