ideas for autocompletion + object selection?

Regular autocompletion gives a string. I would like to select objects given autocompletion on their name. I have just a draft in my mind but the idea would be to somehow suggest matches and set a hidden field if one is clicked/selected/whatever.

Did anybody write something similar?

-- fxn