I'm trying to make myself a little jQuery plugin based on jQueryUI's Autocomplete, because I have a lot of different autocomplete fields which I want to treat differently.
Although every other part of my plugin is working fine, it does one thing that I don't understand. Despite that the onSelect function clearly defines this:
box.val(ui.item.nazev); // item name
boxID.val(ui.item.value);
which I can confirm by listing those elements values after it's been done, for the user the box element somehow shows ui.item.value
I tried every possibility I can think of, none of them worked ... I'm quite desperate.
Plugin is included here: http://jsfiddle.net/meridius/AVA6M/
Edit:
OK, it's quick and dirty, but I managed to make it work in jsfiddle.net without AJAX. It's not perfect (results aren't filtered as typing), but you can see what I mean when you select some result.