I also have this question, but I want to show the name and select by ID
I have this data:
[ { id: 100, name: 'name100'}, { id: 101, name: 'name101'} ]
with this config:
jQuery(".typeahead").typeahead({ highlight: false, hint: false, minLength: 2 }, { name: 'test1', display: 'name' });
I want to select the element with identifier 101, "val" just set the value of the input field and show "101" instead of "name101"
$(input).typeahead('val',101);
https://jsfiddle.net/n03cfgej/3/
How can I choose a product by ID?
safar developer
source share