Friday, July 20, 2012

JQuery or Ajax Autocomplete Example

JQuery or Ajax Autocomplete Example:

      The autocomplete can be used to add dynamic behaviour to the text box. If i type a character in the text box, the related words for that character we can display as a suggestion. We can set several options like after how many characters results should be displayed,length of the suggestion box, width of the suggestion box. We can limit the number of suggestions to display. The following example shows a list of suggested cities when you enter a character. Follow the below steps to use Jquery autocomplete program.

Step 1: The following three files are needed in this program. They are

1. jquery-ui-1.8.13.custom.css
2. jquery.js
3. jquery-ui-1.8.13.custom.min.js

The above three files you can download from the following source.


Step2: The above folder contains AutoCompleteDemo.html. If you run that page, you will see the following page.