Link to home
Start Free TrialLog in
Avatar of PeterHing
PeterHingFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Arrays

Hiya Guys,

Can anyone see where i'm going wrong?
It seems the last box doesn't want to open.
I have removed all the 'csa's as they are people

Many Thanks,

Pete:)


<HTML>
<HEAD>
<META NAME="GENERATOR" Content="">
<Title></Title>
<SCRIPT LANGUAGE=JavaScript>

csa = new Array
csa [0] = new Array
csa [1] = new Array
csa [2] = new Array
csa [3] = new Array
csa [4] = new Array
csa [5] = new Array
csa [6] = new Array
csa [7] = new Array
csa [8] = new Array
csa [9] = new Array
csa [10] = new Array
csa [11] = new Array
csa [12] = new Array
csa [13] = new Array
csa [14] = new Array
csa [15] = new Array

//Empty
csa [0][0.0] = " "
csa [0][0.1] = " "

//A
csa [1][0.0] =  
csa [1][0.1] =

//B
csa [2][0.0] =
csa [2][0.1] =

//C
csa [3][0.0] =
csa [3][0.1] =

//D
csa [4][0.0] =
csa [4][0.1] =

//E
csa [5][0.0] =
csa [5][0.1] =

//F
csa [6][0.0] =
csa [6][0.1] =

//G
csa [7][0.0] =
csa [7][0.1] =

//H
csa [8][0.0] =
csa [8][0.1] =

//I
csa [9][0.0] =
csa [9][0.1] =

//J
csa [10][0.0] =
csa [10][0.1] =

//K
csa [11][0.0] =
csa [11][0.1] =

//L
csa [12][0.0] =
csa [12][0.1] =

//M
csa [13][0.0] =
csa [13][0.1] =

//N
csa [14][0.0] =
csa [14][0.1] =

//O
csa [15][0.0] =
csa [15][0.1] =

function FillList()
{
var num=document.formname.team.selectedIndex
var boxlength = 0

document.formname.csa.selectedIndex = 0
for ( ctr=0;ctr<reasons[num].length;ctr++)
 {
 boxlength++;
 document.formname.csa.options[ctr] = new Option(csa[num] [eval(ctr + ".1")], csa[num][eval(ctr + ".0")]);
 }

document.formname.csa.length = boxlength;
document.formname.csa.options.length = boxlength;
document.formname.csa.focus() ;

}

</SCRIPT>
</HEAD>
<BODY>
<FORM action="" method=post id=form1 name=formname>
<SELECT id=select1 name=team onChange="JavaScript:FillList()">
<OPTION value=""></OPTION>
<OPTION value=A>A</OPTION>
<OPTION value=B>B</OPTION>
<OPTION value=C>C</OPTION>
<OPTION value=D>D</OPTION>
<OPTION value=E>E</OPTION>
<OPTION value=F>F</OPTION>
<OPTION value=G>G</OPTION>
<OPTION value=H>H</OPTION>
<OPTION value=I>I</OPTION>
<OPTION value=J>J</OPTION>
<OPTION value=K>K</OPTION>
<OPTION value=L>L</OPTION>
<OPTION value=M>M</OPTION>
<OPTION value=N>N</OPTION>
<OPTION value=O>O</OPTION>

</SELECT>

<p>
<SELECT id=select2 name=csa>
<OPTION></OPTION>
</SELECT>
ASKER CERTIFIED SOLUTION
Avatar of Batalf
Batalf
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial