BrandSNew Autocomplete

Read more and download "BrandSNew Autocomplete"

The AutoSuggest class adds a popdown menu of suggested values to a text field. The user can either click directly on a suggestion to enter it into the field, or navigate the list using the up and down arrow keys, selecting a value using the tab key. The values for the suggestion list are to provided as XML (by a PHP script, or similar).

The AutoSuggest class adds a pulldown menu of suggested values to a text field. The user can either click directly on a suggestion to enter it into the field, or navigate the list using the up and down arrow keys, selecting a value using the enter key. The values for the suggestion list are to provided as XML, or as JSON (by a PHP script, or similar).

The results of the first request are cached on the client machine and are filtered as the user continues to type, to reduce the number of requests hitting the server.

In the JSON example above a callback function is passed to the autoSuggest instance. It is called when the user selects an entry, and inserts the entry id into a hidden field (visible for this example).




Visit PhpDaddy.com


Play with this script by changing the html bellow. Submit your changes by clicking on this bar. Refresh the page to reset changes.
Play with this script by changing the html above. Submit your changes by clicking on this bar. Refresh the page to reset changes.

Comment on this example

Name
Url
Comment
Captcha
 

 

1
Drew Foster
2007-12-13 10:15:23
I am most impressed with this. Amazing! Just curious: Is there any way to create this using a A-Z 0-9 link list (alphabetical listing) that when you mouse over each letter/number, a dropdown gets populated with content starting with the letter associated with the link? I am just trying to figure out a way to get rid of the type in form field. In my opinion, giving users a blank form field is a bit confusing. But when you guide them using an alphabetical index A|B|C|D etc... you are already steering them to what to associated content. Think phone book...how do you find stuff in it? Alphabetically by topic... Any feedback on this? Thanks! Please keep up the good work!

2
Rasegan
2007-11-24 23:30:24
Nice one keep it up

3
Shekhar
2007-10-29 05:05:49
wow it beuty man