im trying to implement typeahead in mvc 4.
(i included the the typeahead js and css.)
Im using this ajax method in order to get the list
$(function() {
// get your list
$.getJSON('/Main/GetServiceNames', function (allData) {
$('#servicename').typeahead({source: allData});
});
});
This is the result of the ajax request :
["RetrieveDocument","PublishDocument","PublishFeedback","PublishSurvey","RetrievePartner","RetrieveLabelDocuments","RPCRetrieveZipCode","ESB2InfraService","PublishTest","PublishPolcy"]
But for some reason the result wont bind to the #servicename Html input
This is the html that im trying to bind to and none of the list is shown.
<input type="text" class="form-control" placeholder="servicename" id="servicename" data-provide="typeahead">
EDIT: i managed to create the same error here typeahead fiddel
thanks
miki