<form name="doublecombo" action="#" method=post>
<table border="0" cellPadding="0" cellSpacing="0" width="601" height="19">
<tr>
<td height="14" width="601" colspan="2"> <p align="center"><font color="midnightblue">基本项目查询统计
</font></p></td>
</tr>
<Tr>
<td height="14" width="601"> <select name="example" size=1 onChange="redirect(this.options.selectedIndex)">
<option value="0">000</option>
<option value="1">111</option>
<option value="2">222</option>
<option value="3">333</option>
</select> <select name="stage2" size=1>
<option value="0">项目属性</option>
<input type="text" name="stage3" size="12">
<script>
<!--
var groups=document.doublecombo.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("000") group[1][0]=new Option("10","") group[2][0]=new Option("20","") group[3][0]=new Option("30","")var temp=document.doublecombo.stage2
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
//以下是增加的代码
doublecombo.stage3.value=doublecombo.example.options[doublecombo.example.selectedIndex].text;
}
function go(){
location=temp.options[temp.selectedIndex].value
}
-->
</script> </td>
<td height="14" width="340"> </td>
</tr>
</table>
</form>
<table border="0" cellPadding="0" cellSpacing="0" width="601" height="19">
<tr>
<td height="14" width="601" colspan="2"> <p align="center"><font color="midnightblue">基本项目查询统计
</font></p></td>
</tr>
<Tr>
<td height="14" width="601"> <select name="example" size=1 onChange="redirect(this.options.selectedIndex)">
<option value="0">000</option>
<option value="1">111</option>
<option value="2">222</option>
<option value="3">333</option>
</select> <select name="stage2" size=1>
<option value="0">项目属性</option>
<input type="text" name="stage3" size="12">
<script>
<!--
var groups=document.doublecombo.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("000") group[1][0]=new Option("10","") group[2][0]=new Option("20","") group[3][0]=new Option("30","")var temp=document.doublecombo.stage2
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
//以下是增加的代码
doublecombo.stage3.value=doublecombo.example.options[doublecombo.example.selectedIndex].text;
}
function go(){
location=temp.options[temp.selectedIndex].value
}
-->
</script> </td>
<td height="14" width="340"> </td>
</tr>
</table>
</form>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000">
<form name="doublecombo" action="#" method=post>
<table border="0" cellPadding="0" cellSpacing="0" width="601" height="19">
<Tr>
<td height="14" width="601"> <select name="example" size=1
onChange="redirect(this.options.selectedIndex)">
<option value="0">000</option>
<option value="1">111</option>
<option value="2">222</option>
<option value="3">333</option>
</select>
<input type="text" name="stage3" size="12">
<br>
<select name="example" size=1
onChange="redirect(this.options.selectedIndex)">
<option value="0">000</option>
<option value="1">111</option>
<option value="2">222</option>
<option value="3">333</option>
</select>
<input type="text" name="stage3" size="12">
<script>
<!--
var groups=document.doublecombo.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0]=new Option("000")
group[1]=new Option("10","")
group[2]=new Option("20","")
group[3]=new Option("30","")var temp=document.doublecombo.stage3
function redirect(x){
temp.value=doublecombo.example.options[doublecombo.example.selectedIndex].text;
}
-->
</script> </td>
<td height="14" width="340"> </td>
</tr>
</table>
</form>
</body>
</html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000">
<form name="doublecombo" action="#" method=post>
<table border="0" cellPadding="0" cellSpacing="0" width="601" height="19">
<Tr>
<td height="14" width="601"> <select name="example1" size=1
onChange="redirect(this.options.selectedIndex)">
<option value="0">000</option>
<option value="1">111</option>
<option value="2">222</option>
<option value="3">333</option>
</select>
<input type="text" name="stage3" size="12">
</td></tr><tr><td>
<select name="example1" size=1
onChange="redirect(this.options.selectedIndex)">
<option value="0">000</option>
<option value="1">111</option>
<option value="2">222</option>
<option value="3">333</option>
</select>
<input type="text" name="stage3" size="12">
<script>
<!--
function redirect(x){
var txtobj = window.event.srcElement.parentElement.children[1]; txtobj.value=window.event.srcElement.options[x].value;
}
-->
</script> </td>
<td height="14" width="340"> </td>
</tr>
</table>
</form>
</body>
</html>
不好意思,是我没说明白,我想作的是,在下拉菜单选择后,文本框显示相应传入的数组里的值
<form name="doublecombo" action="#" method=post>
<table border="0" cellPadding="0" cellSpacing="0" width="601" height="19">
<tr>
<td height="14" width="601" colspan="2"> <p align="center"><font color="midnightblue">
</font></p></td>
</tr>
<Tr>
<td height="14" width="601"> <select name="example" size=1 onChange="redirect(this.options.selectedIndex)">
<option value="0">000</option>
<option value="1">111</option>
<option value="2">222</option>
<option value="3">333</option>
</select> <select name="stage2" size=1>
<option value="0">000</option>
<script>
<!--
var groups=document.doublecombo.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("000")
group[1][0]=new Option("10","")
group[2][0]=new Option("20","")
group[3][0]=new Option("30","")var temp=document.doublecombo.stage2
var temp2=document.doublecombo.stage3
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
}
function go(){
location=temp.options[temp.selectedIndex].value
}
-->
</script> </td>
<td height="14" width="340"> </td>
</tr>
</table>
</form>
<table border="0" cellPadding="0" cellSpacing="0" width="601" height="19">
<tr>
<td height="14" width="601" colspan="2"> <p align="center"><font color="midnightblue">
</font></p></td>
</tr>
<Tr>
<td height="14" width="601"> <select name="example" size=1 onChange="redirect(this.options.selectedIndex)">
<option value="0">000</option>
<option value="1">111</option>
<option value="2">222</option>
<option value="3">333</option>
</select> <select name="stage2" size=1>
<option value="0">000</option>
<input type="text" name="stage3" size="12">
<script>
<!--
var groups=document.doublecombo.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("000")
group[1][0]=new Option("10","")
group[2][0]=new Option("20","")
group[3][0]=new Option("30","")var temp=document.doublecombo.stage2
var temp2=document.doublecombo.stage3
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=truedocument.all.stage3.value=group[x][0].text; }
function go(){
location=temp.options[temp.selectedIndex].value
}
-->
</script> </td>
<td height="14" width="340"> </td>
</tr>
</table>
</form>