Jump to content

autocomplete in textbox using AJAX


Recommended Posts

You're going to need a script that will get a string from the page and search through a database for strings that begin with the target string, and return a list of those words. Creating the textbox will be more difficult, because you need some Javascript that will pop up a list of words, and clicking on one of the words will populate the textbox with the word that was clicked. It probably won't be as fast as you hoped though, because if someone types at a decent speed then by the time they hit the third or fourth character, the results from the first character are just coming back. I guess it depends on how fast the database server is, how many words it is searching through, and how much bandwidth the user has. It may take several seconds for a decently large list of words to make it from the database to the client and be shown.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...