<script>
function showOptions(){
var arr=new Array();
arr[0]=document.all.select1.value;
arr[1]=document.all.select2.value;
var myAjax = new Ajax.Request(
'test?pars='+arr,
{
method: 'post',
parameters:'',
onSuccess: function(t) {showResponse(t)}
});
}
function showResponse(t)
{
document.all.input1.value=t.responseText;
}
</script>
<body>
<select id=select1 onchange="showOptions()">
<option value='1'>1</option>
....
</select>
<select id=select2 onchange="showOptions()">
<option value='A'>A</option>
....
</select>
<input type=text id=input1 value="">
</body>
function showOptions(){
var arr=new Array();
arr[0]=document.all.select1.value;
arr[1]=document.all.select2.value;
var myAjax = new Ajax.Request(
'test?pars='+arr,
{
method: 'post',
parameters:'',
onSuccess: function(t) {showResponse(t)}
});
}
function showResponse(t)
{
document.all.input1.value=t.responseText;
}
</script>
<body>
<select id=select1 onchange="showOptions()">
<option value='1'>1</option>
....
</select>
<select id=select2 onchange="showOptions()">
<option value='A'>A</option>
....
</select>
<input type=text id=input1 value="">
</body>
servlet根据select1和select2的值从数据库中找出字段C,然后返回C