Autocomplete Widget Autocomplete enables users to quickly find and select from a pre-populated list of values as they type, leveraging searching and filtering.

By giving an Autocomplete field focus or entering something into it, the plugin starts searching for entries that match and displays a list of values to choose from. By entering more characters, the user can filter down the list to better matches.

This can be used to choose previously selected values, such as entering tags for articles or entering email addresses from an address book. Autocomplete can also be used to populate associated information, such as entering a city name and getting the zip code.

You can pull data in from a local or remote source: Local is good for small data sets, e.g., an address book with 50 entries; remote is necessary for big data sets, such as a database with hundreds or millions of entries to select from. To find out more about customizing the data soure, see the documentation for the source option.

Keyboard interaction

When the menu is open, the following key commands are available:

When the menu is closed, the following key commands are available:

1.8 Triggered when the field is blurred, if the value has changed. The item selected from the menu, if any. Otherwise the property is null. Triggered when the menu is hidden. Not every close event will be accompanied by a change event. Triggered when focus is moved to an item (not selecting). The default action is to replace the text field's value with the value of the focused item, though only if the event was triggered by a keyboard interaction.

Canceling this event prevents the value from being updated, but does not prevent the menu item from being focused.

The focused item.
Triggered when the suggestion menu is opened or updated. Triggered after a search completes, before the menu is shown. Useful for local manipulation of suggestion data, where a custom source option callback is not required. This event is always triggered when a search completes, even if the menu will not be shown because there are no results or the Autocomplete is disabled. Contains the response data and can be modified to change the results that will be shown. This data is already normalized, so if you modify the data, make sure to include both value and label properties for each item. Triggered before a search is performed, after minLength and delay are met. If canceled, then no request will be started and no items suggested. Triggered when an item is selected from the menu. The default action is to replace the text field's value with the value of the selected item.

Canceling this event prevents the value from being updated, but does not prevent the menu from closing.

The selected item.
Closes the Autocomplete menu. Useful in combination with the search method, to close the open menu. Triggers a search event and invokes the data source if the event is not canceled. Can be used by a selectbox-like button to open the suggestions when clicked. When invoked with no parameters, the current input's value is used. Can be called with an empty string and minLength: 0 to display all items. Returns a jQuery object containing the menu element. Although the menu items are constantly created and destroyed, the menu element itself is created during initialization and is constantly reused. A simple jQuery UI Autocomplete Select a programming language: ]]>