I'm using bootstrap-typeahead.js v2.0.3 to autocomplete an text input. I'm also using gravity form's Dynamic Population to add a value to the autocomplete text input. How can I trigger the autocomplete to look up data related to the dynamically populated value?
I've tried to add simple jQuery trigger functions, with no luck.
Here is a snippit of my autocomplete (typeahead) initialization:
$('.restaurant_name input').typeahead({
source: function(typeahead, query) {
var _this = this;
return $.ajax({
url: "/restaurants.json?q=" + query,
success: function(data) {
return typeahead.process(data);
}
});
}, onselect: function (obj) {
if (obj.City != ''){
$(".restaurant_city input").attr("value", obj.City);
}
if (obj.State != ''){
$(".hotel_state input").attr("value", obj.State);
}
if (obj.Zip != ''){
$(".hotel_zip input").attr("value", obj.Zip);
}
},
property: "LocationName1"
});
Any help would be much appreciated.
Thanks y'all!