function ajax_change list1 list2 ac field var url Ajax do var id list1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
function ajax_change(list1, list2, ac, field) {
var url = "Ajax.do";
var id = $("#"+list1+" option:selected").val();
$.ajax(
{
type: 'POST',
url: url,
data: {ac: ac, field: id},
success: function(data) {
$("#"+list2+" option").remove();
var myArray = data.split(";")
for(i=0; i<myArray.length; i++) {
$("#"+list2).append("<option id="+myArray[i]+">"+myArray[i]+"</option>")
}
}
})
return false;
}