0
I have an app using Jquery 1.9.1 (uses the old version because it has functions in the menu that only work in this version), I’m trying to make the autocomplete, but is giving error
$(...).autocomplete is not a function
Can anyone tell me if that version of Jquery has this function or I’m missing something in the code?
Follows my code:
<input class="form-control form-control-sm" id="cidadesParadas" type="text"/>
//função para pegar os municipios do controller ListaMunicipios()
var municipios = new Array();
window.onload = function listaMunicipios() {
var url = "@Url.Action("ListaMunicipios", "Municipio")";
$.post(url, function (data) {
for (var i = 0; i < data.length; i++) {
municipios.push(data[i].DescMunicipio);
}
});
}
// Chama o Auto complete do JQuery setando o id do input, array com os dados e o mínimo de caracteres para disparar o AutoComplete
$('#cidadesParadas').autocomplete({ source: municipios, minLength: 3 });
That’s right Hudsonph. I didn’t know I had to reference jquery-ui.js. I thought the function was already in Jquery. Thank you!
– Diego Grossi