Autocomplete + Hidden Field in jquery?

ajax, autocomplete, jquery

Solution

You can use the result handler and store the desired value on the hidden input.

Problem

I am trying to do an autocomplete that will display something and then put something else in an hidden field on selection. Example: In my database I have `{[1, 'john'], [2, 'bob'], [3, 'john']}` If the user type '`jo`' and clicks on the first '`john`', I have no way of knowing on what entry he clicked. So I need some kind of associated hidden field to handle this. Is there a jquery plugin that does this or do I have to create my own? I already started and it's working fine with local values, but if I have to get them asynchronously it doesn't work yet. I'm basing mine on this plugin from bassistance. I guess I could get my hands in the code and change the way they handle the responses, but it would save me some time if something was already done !

Original source