I am able to retrieve the name and ID, but I am only able to display the name.
I have attempted using update and afterslected methods.
Currently, I have this code which works well, however, it only fetches the name!
$('input.typeahead').typeahead({
source: function (query, process) {
return $.ajax({
url: "search/autocomplete",
type: "GET",
data: "query=" + query,
success: function(data) {
var data = $.merge( $.merge( [], data['2'] ), data['1'] );
return process(data);
}
});
}
});
The expected outcome is to fetch both the name and the ID (the ID should be displayed in a separate div like #mydiv).
Thank you in advance!