Create Autocomplete Input Field Using jQuery Ajax

When you type something in google it will suggest you a bunch of matching queries instantly which is called autocomplete. These are repeatedly searched queries stored in google servers. Likewise you can create an input field that autocompletes your words or queries from the data stored in MySQL databse.

What is the Purpose of Autocomplete

These are some of the uses of having autocomplete input fields.

If you have some sort of form in your page and a user have to submit multiple forms. They don’t have to type full words again and again as autocomplete will suggest the full word by matching the previous entry.

Lets say you have a search engine or your site’s inner search page where users type and find the results. You can store the queries being typed by the users and suggest the most searched queries or keywords when they try to type another time.

If you have a text editor kind of page where people can type many paragraphs and send email or publish as a blog etc. It will be useful if you can autocomplete their words as they have to type many long paragraphs.

If you have a social network kind of website you can have a user search box like facebook to extract user data below when people type their names.

If you want you can use the jQuery UI autocomplete widget or learn to create it from the scratch here.