shmoyko
06-15-2010, 01:07 PM
I spent all day trying to figure this one out.
I need to autocomplete an <input> field from the following list:
source: [{"name":"Some Name","id":1},{"name":"Some Othername","id":2}]
How can I use the jQuery UI autocomplete to
1. display the name in the autocomplete pop-out, and
2. insert the id into a hidden field when the name is selected
The form is simple:
<form name="blah" method="post" action="...">
<fieldset>
<input type="text" name="np_from" />
<input type="hidden" name="np_id" id="np_id" />
</fieldset>
</form>
Many thanks.
I need to autocomplete an <input> field from the following list:
source: [{"name":"Some Name","id":1},{"name":"Some Othername","id":2}]
How can I use the jQuery UI autocomplete to
1. display the name in the autocomplete pop-out, and
2. insert the id into a hidden field when the name is selected
The form is simple:
<form name="blah" method="post" action="...">
<fieldset>
<input type="text" name="np_from" />
<input type="hidden" name="np_id" id="np_id" />
</fieldset>
</form>
Many thanks.