Jim,

>Quick question - how do you move the selected value into a hidden form
>field?

Use the findValue() method to look up the data in the input element. How you
trigger it is up to you, but remember that the findValue() is an
asynchronous event--so you must define the onFindValue mapping in order to
process the value.

The reason it's asynchronous is that the findValue() may need to do an AJAX
operation to look up the value.

On my demo page (http://www.pengoworks.com/workshop/jquery/autocomplete.htm)
the "Get Value" buttons show off the use of the findValue() method. You'll
notice that the code that gets execute after the value is found is in the
findValue() function (which is what's configured as the findValue() method
callback function.)

Just remember that if you call the findValue() on the field's onBlur event
that due to the asynchronous nature, that unless you program something in to
handle it, a user could potentially submit a form before the findValue()
call is done running. For example, you could prevent form submissions during
asynchronous tasks to prevent this from happening.

-Dan

Reply via email to