You are retrieving JSON from a remote server, so you need to map the
JSON into Autocomplete's menu of download items. Here's a
simplified, much shorter bit of working code that can be a model for
your Autocomplete. Note the map() function in the success: option. You
probably don't need the data:option.
$('#stateProvince').autocomplete({
source: function(request, response) {
//Pass the selected country to the php query
manager to limit the stateProvince selection to just that country
$.ajax({
url: '../phpFunctions/getStateProvince.php',
data: {
country:
$('input[name=country]:checked').val() //Pass the selected countryAbbreviation
},
type: 'POST', // a jQuery ajax POST transmits in
querystring format (key=value&key1=value1) in utf-8
dataType: 'json', //return data in json format
success: function(data) {
response($.map( data, function(item) {
return {
label: item.stateName,
value: item.name,
abbrev: item.stateAbbrev
};
}));
}
});
}
Chrome Developer Tools or FF Firebug can show you the data and
headers sent from the browser to the server, and the JSON response
back from the server. This info is essential for debugging.