三级联动完整代码出现错误!200分送! 很急!!!!!!!!!!!11谢谢了!
cenpy 2005-05-15 05:41:25 这个是完整的代码!基本功能已经写好了!还差三级联结那里出现问题!2级选择了后,3级没任何反应!而且最后的提示窗口中不能提取2、3级的数据!希望谁能帮帮我??
真的很急!!谢谢!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {
font-size: 24px;
font-weight: bold;
}
.style5 {font-size: 18px}
-->
</style>
</head>
<SCRIPT>
//(c)2000 Webteacher Software, LLC
//http://www.webteacher.com
platform=window.navigator.appVersion;
ie3=0;
if (platform.indexOf('MSIE 3')>0) {
ie3=1;
}
triphop=new Array()
triphop[0]="masstiveattack";
triphop[1]="potishead";
jpop=new Array()
jpop[0]="LovePsychedelicot";
RB=new Array()
RB[0]="thecardigans";
RB[1]="natalieimbruglia";
thecardigans=new Array()
thecardigans[0]="Emmerdale";
thecardigans[1]="Life";
thecardigans[2]="First Band On The Moon";
thecardigans[3]="Gran Turismo";
thecardigans[4]="Long Gone Before Daylight";
thecardigans[5]="Other Side of the Moon";
thecardigans[6]="Long Gone Before Daylight";
thecardigans[7]="Long Gone Before Daylight";
natalieimbruglia=new Array()
natalieimbruglia[0]="Left Of The Middle";
natalieimbruglia[1]="White Lilies Island";
potishead=new Array()
potishead[0]="potishead";
potishead[1]="bloom";
massiveattack=new Array()
massiveattack[0]="Singles 90/98";
massiveattack[1]="Mezzanine";
massiveattack[2]="100th windows";
massiveattack[3]="Formica Blue";
LovePsychedelico=new Array()
LovePsychedelico[0]="Early Times";
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]);
};
f.list2.selectedIndex=0;
};
function setList2(f) {
if (ie3) {
alert('Changable lists do not work with Internet Explorer 3');
return;
};
secondlist2=eval(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(secondlist2[i]);
};
f.list3.selectedIndex=0;
};
function BuySubmit(f)
{
//if(f.yourname.value.length==0){
//alert("Your name can't be ignored!");
//return;}
//if(f.youraddress.value.length==0){
//alert("Your address can't be ignored!");
//return;}
//if(f.yourphone.value.length==0){
//alert("Your phone can't be ignored!");
//return;}
//var SuccessMessage="You have successfully bought "+f.list1.value+"'s"+f.list2.value+" CDS!";
//alert(SuccessMessage);
customerName = prompt('Type your name:',"");
if(customerName.length==0)
{
alert("Your name are incorrect!");
return;
}
customerEmail = prompt('Type your Email:',"");
if(customerEmail.length==0)
{
alert("Your Email are incorrect!");
return;
}
customerAddress = prompt('Type your address:',"");
if(customerAddress.length==0)
{
alert("Your address are incorrect!");
return;
}
customerPhone = prompt('Type your phone:',"");
if(customerPhone.length==0)
{
alert("Your phone are incorrect!");
return;
}
var SuccessMessage="You have successfully bought "+f.list1.value+"'s CDS:"+f.list2.selectedIndex.value;
alert(SuccessMessage);
};
</SCRIPT>
<body>
<p align="center" class="style1">Welcome to nicole's CD shop!</p>
<p> </p>
<p>Choose your CDs:</p>
<FORM NAME="listsform">
<p> </p>
<table width="326" border="0" cellpadding="0" cellspacing="0">
<tr>
<td ><div align="left">Type of music:</div></td>
<td ><select name="list1" onChange="setList(form)">
<option value="triphop">trip-hop</option>
<option value="jpop">j-pop</option>
<option value="RB">R&B</option>
</select></td>
</tr>
<tr>
<td><div align="left">Artist:</div></td>
<td><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></td>
</tr>
<tr>
<td><div align="left">CDs:</div></td>
<td><select name="list3">
<option> </option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
</select></td>
</tr>
</table>
<p> </p>
<p>
<INPUT type=button value=Buy name=Submit onClick="BuySubmit(form)">
</p>
</FORM>
<p>
</p>
</body>
</html>