Autocomplete and extraParams
I'm trying to understand how extraParams works in this plugin and... I do not get it at all.
This is my test script:
$(function() {
$("#state").autocomplete({
source: "test.php",
minLength: 2,
extraParams: {city: function() { return $("#city").val(); }} ,
select: function(event, ui) {
$('#state_id').val(ui.item.id);
$('#abbrev').val(ui.item.abbrev);
}
});
});
Looks like everything is ok but... it does not work. It takes only 'term' but no way to send extra parameters to the php script. Even if this is prymitive extraParams: {"city":"something"} or extraParams {city:"something"} ..or else... Is there any typo in the code?