<select name="nameSelect" id="nameSelect" onChange="document.getElementById('eName').value = this.options[this.selectedIndex].getAttribute('eName')">
<option value='' eName=''>请选择</option>
<option value='我' eName='i'>我</option>
<option value='你' eName='you'>你</option>
<option value='他' eName='he'>他</option>
<select>
<input name="eName" id="eName" value=''>
<option value='' eName=''>请选择</option>
<option value='我' eName='i'>我</option>
<option value='你' eName='you'>你</option>
<option value='他' eName='he'>他</option>
<select>
<input name="eName" id="eName" value=''>
怎样吧这段程序改成3级联动的啊??<script language = "JavaScript">var onecount;
onecount=0;
var subcat = new Array(); <%
int count = 0;
ResultSet rs = stat.executeQuery("select * from tab_zone order by ZoneID");//读取数据
while(rs.next())
{
String sname=rs.getString("ZoneName");//转换字符类型
%>
subcat[<%=count%>] = new Array("<%=sname%>","<%=rs.getInt("FZoneID")%>","<%=rs.getInt("ZoneID")%>");//产生数组
<%
count = count + 1;
}
%>
onecount=<%=count%>;
function changelocation(id)
{
document.form1.smallsortselect.length = 0;
var id=id;
var i;
document.form1.smallsortselect.options[0] = new Option('选择二级分类','');
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == id)
{
document.form1.smallsortselect.options[document.form1.smallsortselect.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
</head>
<form name="form1" method="post" action="">
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="180" height="20" align="right">选择一级分类:</td>
<td width="320">
<select name="bigsortselect" onChange="changelocation(document.form1.bigsortselect.options[document.form1.bigsortselect.selectedIndex].value)" size="1">
<option value="2">请选择一级分类</option>
<%
ResultSet rs1 = stat.executeQuery("select * from tab_zone where FZoneID = 1 order by ZoneID");
String Bname="";while(rs1.next()){
Bname = rs1.getString("ZoneName");
%>
<option value="<%=rs1.getInt("ZoneID")%>"><%=Bname%></option>
<%
}%>
</select><br/>
</td>
</tr>
<br/>
<tr>
<td height="20" align="right">选择二级分类:</td>
<td>
<select name="smallsortselect">
<option value="" selected>请选择二级分类</option>
</select>
</td>
</tr>
<tr>
<td height="20" colspan="2" align="center"><input type="submit" name="Submit" value="提交"></td>
</tr></table>
</form>
<select name="nameSelect" id="nameSelect" onChange="document.getElementById('eName').value = this.options[this.selectedIndex].getAttribute('eName')">
<option value='' eName=''>请选择</option>
<option value='我' eName='i'>我</option>
<option value='你' eName='you'>你</option>
<option value='他' eName='he'>他</option>
<select>
<input name="eName" id="eName" value=''>