Hey all,
I am using the JQuery Autocomplete Plugin for the city name field. The state is chosen using a SELECT html tag before the user types in the city name.
Autocomplete feature works fine initially. But when I change the state from stateA to stateB, I am able to type in cities from both the states, instead of just stateB.
Please advise.
Thank you!
Joe
Following javascript initializes the autocomplete plugin.
$().ready(function() {
$("#city").autocomplete("/cities.html", {
extraParams: {
stateNum: function() {return $("#state").val();},
random: function() {return Math.floor(Math.random() * 1000);}
},
width: 200,
max: 10,
highlight: false,
scroll: true,
scrollHeight: 300,
autoFill: true,
mustMatch: true,
matchContains: false,
formatItem: function(data, i, n, value) {
return value;
},
formatResult: function(data, value) {
return value;
}
});
});