Here is an elegant and very simple autocomplete JQuery solution.
The ‘callback’ part allows to hook in a function, this is where the real magic if thats what you can call it happens.
IF the ‘data’ returned length is more than zero (ie: there is actually something to show), show the suggestionBox and replace the HTML inside with the returned data.
SIMPLE!
Now for the PHP Backend (RPC.php)
Enjoy !