Introduction
This article explains how to create an Auto Complete List using jQuery.
On many sites you must have seen that whenever you start writing in any TextBox then it starts showing the predicted and related results that allow you to choose from a number of available options. The best example is Facebook's Friends Finder and of course Google.
This article will help you to create an application that is similar to those applications.
Let's see the procedure required for creating such an application.
Step 1
First of all you need to create a database in which all the country names are to be entered. I had created such a database and it's attached with the Zip Code available at the top of this article.

Step 2
After that you need to add jQuery 1.8.3 js and Jquery-ui. js file to your application.
You can either download my Zip Code and retrieve both the jQuery files from there or can search for them on Google and can download them from another site.
- <script src="js/jquery-1.8.3.js" type="text/javascript" ></script>
- <script src="js/jquery-ui.js" type="text/javascript" ></script>
Step 3
After adding these jQuery files we will add some JavaScript code that will help to filter the data from the available amount of data. For that you need to add the following code:
- <script type="text/javascript">
- function LoadList()
- {
- var ac=null;
- ac = <%=listFilter %>;
- $( "#Country" ).autocomplete({
- source: ac
- });
- }
- </script>
This code will work on TextBox and will try to filter the data as the user starts to enter the first letter of the country.
Step 4
Now we will work on the design of our application.



vishakha murkarPosted Jan 17, 2017, 2:15 AM
The name 'listFilter' does not exist in the current context error ocuured plz help