I am struggling with the following problem. I use the jQuery autocomplete plugin to get a list of suggested values ββfrom the server. The list will look like this:
Username1 | UserId1
Username2 | UserId2
So, if I start typing "U", a list of "Username1" and "Username2" will appear, as expected. I could select the first element and the <input> value will become "Username1" , but what I really want to send to the server is the user ID.
Is there any way to keep the identifier that follows the username? I intend to make a form message about changing a text field. Maybe I'm too blind to see it in the docs or find it on Google?
javascript jquery autocomplete
Tomalak
source share