Home » Demo » Autocomplete

Autocomplete

This example shows how to use the autocomplete widget with various configurations

Example 1: default configuration

This example uses a static php file, with a random selection of 300 Australian town names from NSW.
It will show an autocomplete widget where you can quickly find town names, by matching from the start of the town name.

Instructions

  1. Type "la" in the field above, to see a few matches.


Example 2: index use

This example uses the same static php file, with a random selection of 300 Australian town names from NSW.
This example sets the index value from the result set, ie: when you choose a value, it will show an autocomplete widget where you can quickly find town names, when you select an entry, the 2nd field shows the "index" value of the selected item; this would usually be a hidden field, but we're displaying it here, to demonstrate how you can choose a seperate value to what you're showing the user:


Instructions

  1. Type "la" in the field above, and choose one of the matches by tabbing off the field.
  2. You will see that the value field now contains a number, which is the index value that the resultset contains.


Example 3: sounds like

This example uses the same static php file, with a random selection of 300 Australian town names from NSW.
This example is configured to use the "sounds like" feature, so you don't need to know how to spell the name of the town:


Instructions

  1. Type "lake cat eye" in the field above, you will see "Lake Cathie", which is what the locals call "Lake cat-eye"
  2. Note: of course you need to support this feature on the back end, for it to work