jQuery-Smart-Auto-Complete icon indicating copy to clipboard operation
jQuery-Smart-Auto-Complete copied to clipboard

Working with ids?

Open OleLaursen opened this issue 13 years ago • 2 comments

With select boxes, the labels and the actual values of the options are decoupled so you can show a nice formatted text to the user and still get an id back to plug directly into the database. I couldn't find an easy way of doing that with your plugin?

OleLaursen avatar Nov 28 '11 11:11 OleLaursen

You can use the resultFormatter option to pass the formatted text to show (check the 7th example in the demo page). Then with the itemSelect event you can get a value (or an id) to send back to the backend.

laktek avatar Dec 04 '11 18:12 laktek

Did you try doing this? I think I looked at the source code and concluded I might end up with a problem. I need to be able to control it the other way around too, i.e. I need to be able to choose a certain id/value if the user presses a button.

In any case, it's not easy to do. :) I don't think it's a bug, just a suggestion for something you may want to improve on. I realize it depends on whether you're using the combo box for free form input or as a select box with a fixed set of values.

OleLaursen avatar Dec 05 '11 11:12 OleLaursen