I have a set of (int,string) pairs I need to display in a JQuery auto-complete box. When a user selects one of the possible string values, I want to get the corresponding int value. Is this possible? If yes, how?
I have a set of (int,string) pairs I need to display in a JQuery
Share
The jQueryUI autocomplete works very well, however it’s not designed to give a corresponding int value when something is autocompleted, so you’ll have to make a few adjustments to the select event and maybe store the int value in a hidden input field.
Another option is to, on the backend, lookup the int value using the selected string, which is how I’m doing it right now.