Auto_complete_for_text_field to association

I am trying to set the association using an auto_complete_for field.

message -> person

To be user friendly, I want to display the person’s name in the text
field, while setting the association id after selecting them from the
auto_complete_results.

To far I get some of it to work, am only get the 1st associattion_id no
matter what item I am selecting from the results.

The only reference I have seen on the list, is using on_hide, which has
not worked for me.

Has anyone else used this technique? Any tips?