<html>
<head>
<script language="javascript">
var xmlHttp;
var select1=null;
function check(){
var select1=document.getElementById("de").value;
if(window.ActiveXObject){
xmlHttp = new ActiveXObject("Microsoft.XmlHttp");
}else if(window.XmlHttpRequest){
xmlHttp = new XmlHttpRequest();
}
xmlHttp.open("GET","list?select="+select1,true);
xmlHttp.send(null);
xmlHttp.onreadystatechange = processResponse;
}
function processResponse(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
var tt=xmlHttp.responseXML.getElementsByTagName("name");
var product=document.getElementById("dd");
while(product.childNodes.length>0){
product.removeChild(product.childNodes[0]);
}
for(var i=0;i<tt.length;i++){
var optionnode=document.createElement("option");
var textnode=document.createTextNode(tt[i].childNodes[0].nodeValue);
optionnode.appendChild(textnode);
product.appendChild(optionnode);
}
}
}
}
</script>
</head>
<body>
<form name="form1" method="get" action="">
<table width="200" border="1">
<tr>
<td>品牌</td>
<td><select id="de" name="select" onChange="check()">
<option value="SONY">SONY</option>
<option value="LENOVO">dell</option>
<option value="IBM">IBM</option>
</select></td>
<td> </td>
</tr>
<tr>
<td>产品</td>
<td><select id="dd" name="select2">
</select></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>