I try this:
$('input[name=recerv_country]').typeahead({
remote : {
url: '?country=%QUERY',
filter: function(data) {
var resultList = data.map(function (item) {
return item.name;
});
return resultList;
}
},
updater : function (item) {
//item = selected item
//do your stuff.
alert(item.name);
alert('foo');
alert('bar');
//dont forget to return the item to reflect them into input
return item;
}
});
Nothing happens, alerts not appears. What I do wrong?
$('input[name=recerv_country]').on('typeahead:selected', function(evt, item) {
alert(item.value);
});