<html>
<head>
<script type="text/javascript" src="jquery.js">
</script>
<script>
function ajax_change() {
var url = "Ajax.do";
var ac = $("#test1 option:selected").val();
$.ajax(
{
type: 'POST',
url: url,
data: {ac: ac},
success: function(data) {
var myArray = data.split(";")
for(i=0; i<myArray.length; i++) {
$("#test2").append("<option id="+myArray[i]+">"+myArray[i]+"</option>")
}
}
})
return false;
}
</script>
</head>
<body>
<select id="test1" onchange="return ajax_change()">
<option value="1">First Option</option>
<option value="2">Second Option</option>
<option value="3">Third Option</option>
</select>
<select id="test2">
</select>
</body>
</html