I have implemented a jQuery autocomplete function to a Bootstrap input. The jQuery autocomplete is working fine but I want to see the results as a combo and I guess it's now happening because I'm using BootStrap.
This is the field that I'm assigning autocomplete:
<div class="form-group">
<label>Employee</label>
<input class="form-control" name="txtEmployee" placeholder="Trabajador">
</div>
$(this).autocomplete({
source: function(request, response) {
$.ajax({
url: '@Url.Content("~/Employee/SearchEmployee")/',
type: 'POST',
contentType: 'application/json',
dataType: "json",
data: JSON.stringify({
employerId: 1,
searchStr: me.val()
}),
success: function(data) {
if (data.success) {
response($.map(data.data, function(item) {
return {
label: "(" + item.EmployeeNumber + ") " +
item.FirstName + " " +
item.MothersLast + ", " +
item.FathersLast,
employeeId: item.EmployeeId
}
}));
}
}
});
},
minLength: 3
});
The results are displayed but like this:
How can I style the results with Bootstrap so I can see them like dropdownlist?
question from:https://stackoverflow.com/questions/28285813/style-jquery-autocomplete-in-a-bootstrap-input-field