get jquery ui autocomplete selected id and save in hidden field then display on page on button click

maqskywalker used Ask the Experts™
I have this jquery  UI autocomplete.

Is there a way to get the selected id from the autocomplete but don't display it on select event.

Instead show the selected value when I click the button.

So for example if I pick Algeria from the autocomplete. It will display Algeria in the textbox and the id 18 in another textbox.

Is it possible to save the selected id in a hidden field and then when I click the button display the value that was stored in hidden field on the page?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2013
Awarded 2012

please check the forked code here:

I added this into the onchange:
else {

Open in new window

and added the ShowID function.



Thanks. Great example

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial