I need to fill the field .txtProvince
with the province name, and the field .txtProvinceHidden
with the province ID (or .txtProvince
can have a 'province_id' attr, maybe).
I found this solution (here):
$(function() {
var provinces = [{id: 1,label: "Alagoas"},{id: 2,label: "Bahia"}];
$(".txtProvince").autocomplete({
source: provinces,
select: function(event,ui) {
$(this).val(ui.label);
$(".txtProvinceHidden").val(ui.id);
}
});
});
So far so good, now comes the problem: when the jquery ui performs the search, i get "forbidden" error.
Here is the url where it seeks to:
http://dicasdedesconto.localhost/[["1","Alagoas"],["2","Bahia"]?term=Ba
And here the error that I see on console:
Forbidden
You don't have permission to access /[["1","Alagoas"],["2","Bahia"] on this server.
Apache/2.2.20 (Ubuntu) Server at dicasdedesconto.localhost Port 80
I'm sure that is a route problem, but i don't know how to solve this. Has anyone had this problem?