The solution for only 2 options is posted here @VinayC :
jQuery UI - Autocomplete source dependent from selected option in different input
But I need a solution for more than two options in my select?
The code is here:
http://jsbin.com/fakuwohupa/edit?html,js,output
<select id="country">
<option value="">Choice one</option>
<option value="1">US</option>
<option value="2">UK</option>
<option value="3">GR</option>
<option value="4">IT</option>
</select>
<form id="aspnetForm" action="" method="post">
Type "A" to test:<input type="text" id="city" >
</form>
$(function() {
var US = [ "City1", "City2", "City3" ];
var UK = [ "UK_City1", "UK_City2", "UK_City3" ];
var GR = [ "Gr_City1", "Gr_City2", "Gr_City3" ];
var IT = [ "It_City1", "It_City2", "It_City3" ];
$('#country').change(function() {
var src = $('#country').val() == '1' ? US : UK;
$("#city").autocomplete('option', 'source', src);
});
$("#city").autocomplete({
source: []
});
});
Thank you