你的数据不全这样
<SCRIPT>
//(c)2000 Webteacher Software, LLC
//http://www.webteacher.complatform=window.navigator.appVersion;
ie3=0;
if (platform.indexOf('MSIE 3')>0) {
ie3=1;
}Fruit=new Array()
Fruit[0]="apple";
Fruit[1]="banana";
Vegetables=new Array()
Vegetables[0]="carrot";
Meat=new Array()
Meat[0]="chicken";
Meat[1]="ham";apple=new Array()
apple[0]="111111";
apple[1]="112221";banana=new Array()
banana[0]="fff";carrot=new Array()
carrot[0]="aa";chicken=new Array()
chicken[0]="5555";ham=new Array()
ham[0]="sdfsdf";secondlist = new Array("a","b")
function setList(f) {
if (ie3) {
alert('Changable lists do not work with Internet Explorer 3');
return;
};
secondlist=eval(f.list1.options[f.list1.selectedIndex].value);
f.list2.options.length=0;
for(i=0;i<secondlist.length;i++) {
f.list2.options[i]=new Option(secondlist[i],secondlist[i]);
};
f.list2.selectedIndex=0;
};function setList2(f) {
if (ie3) {
alert('Changable lists do not work with Internet Explorer 3');
return;
};
secondlist2=f.list2.options[f.list2.selectedIndex].value;
f.list3.options.length=0;
for(i=0;i<secondlist2.length;i++) {
f.list3.options[i]=new Option("a","b");
};
f.list3.selectedIndex=0;
};</SCRIPT>
<body>
<FORM NAME="listsform">
<SELECT NAME="list1" onChange="setList(form)">
<OPTION VALUE="Fruit" SELECTED>Fruit</OPTION>
<OPTION VALUE="Vegetables">Vegetables</OPTION>
<OPTION VALUE="Meat">Meat</OPTION>
</SELECT>
<SELECT NAME="list2" onChange="setList2(form)">
<OPTION> </OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
</SELECT>
<SELECT NAME="list3">
<OPTION> </OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
</SELECT>
</FORM>
</body>
</html>
<SCRIPT>
//(c)2000 Webteacher Software, LLC
//http://www.webteacher.complatform=window.navigator.appVersion;
ie3=0;
if (platform.indexOf('MSIE 3')>0) {
ie3=1;
}Fruit=new Array()
Fruit[0]="apple";
Fruit[1]="banana";
Vegetables=new Array()
Vegetables[0]="carrot";
Meat=new Array()
Meat[0]="chicken";
Meat[1]="ham";apple=new Array()
apple[0]="111111";
apple[1]="112221";banana=new Array()
banana[0]="fff";carrot=new Array()
carrot[0]="aa";chicken=new Array()
chicken[0]="5555";ham=new Array()
ham[0]="sdfsdf";secondlist = new Array("a","b")
function setList(f) {
if (ie3) {
alert('Changable lists do not work with Internet Explorer 3');
return;
};
secondlist=eval(f.list1.options[f.list1.selectedIndex].value);
f.list2.options.length=0;
for(i=0;i<secondlist.length;i++) {
f.list2.options[i]=new Option(secondlist[i],secondlist[i]);
};
f.list2.selectedIndex=0;
};function setList2(f) {
if (ie3) {
alert('Changable lists do not work with Internet Explorer 3');
return;
};
secondlist2=f.list2.options[f.list2.selectedIndex].value;
f.list3.options.length=0;
for(i=0;i<secondlist2.length;i++) {
f.list3.options[i]=new Option("a","b");
};
f.list3.selectedIndex=0;
};</SCRIPT>
<body>
<FORM NAME="listsform">
<SELECT NAME="list1" onChange="setList(form)">
<OPTION VALUE="Fruit" SELECTED>Fruit</OPTION>
<OPTION VALUE="Vegetables">Vegetables</OPTION>
<OPTION VALUE="Meat">Meat</OPTION>
</SELECT>
<SELECT NAME="list2" onChange="setList2(form)">
<OPTION> </OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
</SELECT>
<SELECT NAME="list3">
<OPTION> </OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
</SELECT>
</FORM>
</body>
</html>
解决方案 »
- 请教高手,帮我看看这个问题
- 用JS要怎么判断页面右下脚放的是图片还是flash?
- 一个页面需要大家帮帮忙,感激不敬!!!
- document.player.intsec.value
- 对javascript 感兴趣 或是技能还可以的请进来写下
- 高分,如何用javascript寫出類vb的ide的界面
- 内页面调用框架object
- 请问各位大哥,怎么实现在一个页面中让文字不间断的连续滚动啊??急!!
- 在mozilla中不能在下拉菜单中执行form1.select1.add(new Option("a","1"))????
- 如何把这个input改为图片?
- 问个表单提交问题.谢谢........
- JS 调用远程XML问题?急!100分!
f.list3.options[i]=new Option("a","b");
secondlist = new Array("a","b")这有什么作用??为什么要改成这样?
我之前2级联的时候f.list2.options[i]=new Option(secondlist[i]);是一个参数是没问题的!