gingerGamgee
01-07-2004, 11:12 PM
I copied the quadrouple combobox code off another thread...I added two more boxes, but I am having problems.
First of all it takes sooo long to load.
Next, I get an error on the fifth combo box. I deleted some of the options for the combo boxes because I am going to fill in my own. I'm not sure if that would affect it or not.
I had the fifth box working perfectly untill I added the sixth box.
I am sure it is something simple I am just not seeing it.
Oh, and I was also wondering....at the end of my script I have an alert message reporting the Option Values that have been choosen. Can I turn that into regular text on the page instead?
Thanks All!
<html>
<head>
<title>DROP TEST</title>
</head>
<body>
<FORM name="CBN">
<table border="0" cellspacing="0" cellpadding="0">
<td nowrap height="11">
<select name="CBN1" size="1"
onChange="ReDirect1(this.options.selectedIndex)">
<option selected>---Select Base Commodity-------------</option>
<option value="S">Steel</option>
<option value ="P">Perishable</option>
<option value ="G">Glass</option>
<option value ="E">Electrical</option>
<option value "W">Wiper Motors and Accessories</option>
</select>
<select name="CBN2" size="1"
onChange="ReDirect2(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select Type--------------</option>
<option value=" " selected>---Select Type--------------</option>
</select>
<select name="CBN3" size="1"
onChange="ReDirect3(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select Group----------------</option>
<option value=" " selected>---Select Group----------------</option>
</select>
<select name="CBN4" size="1"
onChange="ReDirect4(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select Grade----------------</option>
<option value=" " selected>---Select Grade----------------</option>
</select>
<select name="CBN5" size="1"
onChange="ReDirect5(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select Finish----------------</option>
<option value=" " selected>---Select Finish----------------</option>
</select>
<select name="CBN6" size="1"
onChange="ReDirect6(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select Finish----------------</option>
<option value=" " selected>---Select Finish----------------</option>
</select>
<script>
<!--
/* */
var temp=document.CBN.CBN2
var temp1=document.CBN.CBN3
var temp2=document.CBN.CBN4
var temp3=document.CBN.CBN5
var temp4=document.CBN.CBN6
var CB2=document.CBN.CBN1.options.length
var CB3=document.CBN.CBN2.options.length
var CB4=document.CBN.CBN3.options.length
var CB5=document.CBN.CBN4.options.length
var CB6=document.CBN.CBN5.options.length
var ComboBox2=new Array(CB2)
var ComboBox3=new Array(CB2)
var ComboBox4=new Array(CB2)
var ComboBox5=new Array(CB2)
var ComboBox6=new Array(CB2)
var maximum="12"
var max=eval(maximum-1)
/* */
for (a=0; a<=max; a++){
ComboBox2[a]=new Array()
}
for (b=0; b<=max; b++){
ComboBox3[b]=new Array()
for (c=0; c<=max; c++){
ComboBox3[b][c]=new Array()
}}
for (d=0; d<=max; d++){
ComboBox4[d]=new Array()
for (e=0; e<=max; e++){
ComboBox4[d][e]=new Array()
for (f=0;f<=max; f++){
ComboBox4[d][e][f]=new Array()
}}}
for (g=0; g<=max; g++){
ComboBox5[g]=new Array()
for (h=0; h<=max; h++){
ComboBox5[g][h]=new Array()
for (i=0; i<=max; i++){
ComboBox5[g][h][i]=new Array()
for (j=0; j<=max; j++){
ComboBox5[g][h][i][j]=new Array()
}}}}
for (k=0; k<=max; k++){
ComboBox6[k]=new Array()
for (l=0; l<=max; l++){
ComboBox6[k][l]=new Array()
for (n=0; n<=max; n++){
ComboBox6[k][l][n]=new Array()
for (p=0; p<=max; p++){
ComboBox6[k][l][n][p]=new Array()
for (q=0; q<=max; q++){
ComboBox6[k][l][n][p][q]=new Array()
}}}}}
ComboBox2[0][0]=new Option("---Select Type---"," ");
ComboBox2[1][0]=new Option("Now Select Type"," ");
ComboBox2[1][1]=new Option("Flat","F");
ComboBox2[1][2]=new Option("Tube","T");
ComboBox2[1][3]=new Option("Bar","B");
ComboBox2[2][0]=new Option("Now Select Type"," ");
ComboBox3[0][0][0]=new Option("---Select Group---"," ");
ComboBox3[1][0][0]=new Option("---Select Group---"," ");
ComboBox3[1][1][0]=new Option("Now Select Group"," ");
ComboBox3[1][1][1]=new Option("Plate","P");
ComboBox3[1][1][2]=new Option("Sheet","S");
ComboBox3[1][1][3]=new Option("Mesh","M");
ComboBox3[1][1][4]=new Option("Checker","C");
ComboBox3[1][2][0]=new Option("Now Select Group"," ");
ComboBox3[2][0][0]=new Option("---Select 3---"," ");
ComboBox3[2][1][0]=new Option("Now Select Group"," ");
ComboBox3[2][2][0]=new Option("Now Select Group"," ");
ComboBox4[0][0][0][0]=new Option("---Select ---"," ");
ComboBox4[1][0][0][0]=new Option("---Select ---"," ");
ComboBox4[1][1][1][0]=new Option("Now Select Grade"," ");
ComboBox4[1][1][1][1]=new Option("Mild","M");
ComboBox4[1][1][1][2]=new Option("Rops","R");
ComboBox4[1][1][1][3]=new Option("SS","S");
ComboBox4[2][0][0][0]=new Option("---Select ---"," ");
ComboBox5[0][0][0][0][0]=new Option("---Select ---"," ");
ComboBox5[1][0][0][0][0]=new Option("---Select ---"," ");
ComboBox5[1][1][0][0][0]=new Option("---Select ---"," ");
ComboBox5[1][1][1][0][0]=new Option("Now Select Finish"," ");
ComboBox5[1][1][1][1][0]=new Option("Now Select Finish"," ");
ComboBox5[1][1][1][1][1]=new Option("P&O","P");
ComboBox5[1][1][1][1][2]=new Option("Dry","D");
ComboBox5[1][1][1][1][3]=new Option("Blast","B");
ComboBox6[0][0][0][0][0][0]=new Option("---Select ---"," ");
ComboBox6[1][0][0][0][0][0]=new Option("---Select ---"," ");
ComboBox6[1][1][1][1][0][0]=new Option("Now Select Traceablity"," ");
ComboBox6[1][1][1][1][1][1]=new Option("Yes","Y");
ComboBox6[1][1][1][1][1][2]=new Option("No","N");
/* */
function ReDirect1(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<ComboBox2[x].length;i++){
temp.options[i]=new Option(ComboBox2[x][i].text,ComboBox2[x][i].value)
}
temp.options[0].selected=true
ReDirect2(0)
}
function ReDirect2(y){
var x=document.CBN.CBN1.options.selectedIndex
for (m=temp1.options.length-1;m>0;m--)
temp1.options[m]=null
for (i=0;i<ComboBox3[x][y].length;i++){
temp1.options[i]=new Option(ComboBox3[x][y][i].text,ComboBox3[x][y][i].value)
}
temp1.options[0].selected=true
ReDirect3(0)
}
function ReDirect3(z){
var x=document.CBN.CBN1.options.selectedIndex
var y=document.CBN.CBN2.options.selectedIndex
for (m=temp2.options.length-1;m>0;m--)
temp2.options[m]=null
for (i=0;i<ComboBox4[x][y][z].length;i++){
temp2.options[i]=new Option(ComboBox4[x][y][z][i].text,ComboBox4[x][y][z][i].value)
}
temp2.options[0].selected=true
ReDirect4(0)
}
function ReDirect4(a){
var x=document.CBN.CBN1.options.selectedIndex
var y=document.CBN.CBN2.options.selectedIndex
var z=document.CBN.CBN3.options.selectedIndex
for (m=temp3.options.length-1;m>0;m--)
temp3.options[m]=null
for (i=0;i<ComboBox5[x][y][z][a].length;i++){
temp3.options[i]=new Option(ComboBox5[x][y][z][a][i].text,ComboBox5[x][y][z][a][i].value)
}
temp3.options[0].selected=true
ReDirect5(0)
}
function ReDirect5(b)
{
var x=document.CBN.CBN1.options.selectedIndex
var y=document.CBN.CBN2.options.selectedIndex
var z=document.CBN.CBN3.options.selectedIndex
var a=document.CBN.CBN4.options.selectedIndex
for (m=temp4.options.length-1;m>0;m--)
temp4.options[m]=null
for (i=0;i<ComboBox6[x][y][z][a][b].length;i++){
temp4.options[i]=new Option(ComboBox6[x][y][z][a][b][i].text,ComboBox6[x][y][z][a][b][i].value)
}
temp4.options[0].selected=true
}
function ReDirect6(c)
{
d = document.forms[0];
alert(d.CBN1.value + d.CBN2.value);
}
//-->
</script>
</td>
</tr>
</table>
</FORM>
</font>
</p>
</body>
</html>
First of all it takes sooo long to load.
Next, I get an error on the fifth combo box. I deleted some of the options for the combo boxes because I am going to fill in my own. I'm not sure if that would affect it or not.
I had the fifth box working perfectly untill I added the sixth box.
I am sure it is something simple I am just not seeing it.
Oh, and I was also wondering....at the end of my script I have an alert message reporting the Option Values that have been choosen. Can I turn that into regular text on the page instead?
Thanks All!
<html>
<head>
<title>DROP TEST</title>
</head>
<body>
<FORM name="CBN">
<table border="0" cellspacing="0" cellpadding="0">
<td nowrap height="11">
<select name="CBN1" size="1"
onChange="ReDirect1(this.options.selectedIndex)">
<option selected>---Select Base Commodity-------------</option>
<option value="S">Steel</option>
<option value ="P">Perishable</option>
<option value ="G">Glass</option>
<option value ="E">Electrical</option>
<option value "W">Wiper Motors and Accessories</option>
</select>
<select name="CBN2" size="1"
onChange="ReDirect2(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select Type--------------</option>
<option value=" " selected>---Select Type--------------</option>
</select>
<select name="CBN3" size="1"
onChange="ReDirect3(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select Group----------------</option>
<option value=" " selected>---Select Group----------------</option>
</select>
<select name="CBN4" size="1"
onChange="ReDirect4(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select Grade----------------</option>
<option value=" " selected>---Select Grade----------------</option>
</select>
<select name="CBN5" size="1"
onChange="ReDirect5(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select Finish----------------</option>
<option value=" " selected>---Select Finish----------------</option>
</select>
<select name="CBN6" size="1"
onChange="ReDirect6(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select Finish----------------</option>
<option value=" " selected>---Select Finish----------------</option>
</select>
<script>
<!--
/* */
var temp=document.CBN.CBN2
var temp1=document.CBN.CBN3
var temp2=document.CBN.CBN4
var temp3=document.CBN.CBN5
var temp4=document.CBN.CBN6
var CB2=document.CBN.CBN1.options.length
var CB3=document.CBN.CBN2.options.length
var CB4=document.CBN.CBN3.options.length
var CB5=document.CBN.CBN4.options.length
var CB6=document.CBN.CBN5.options.length
var ComboBox2=new Array(CB2)
var ComboBox3=new Array(CB2)
var ComboBox4=new Array(CB2)
var ComboBox5=new Array(CB2)
var ComboBox6=new Array(CB2)
var maximum="12"
var max=eval(maximum-1)
/* */
for (a=0; a<=max; a++){
ComboBox2[a]=new Array()
}
for (b=0; b<=max; b++){
ComboBox3[b]=new Array()
for (c=0; c<=max; c++){
ComboBox3[b][c]=new Array()
}}
for (d=0; d<=max; d++){
ComboBox4[d]=new Array()
for (e=0; e<=max; e++){
ComboBox4[d][e]=new Array()
for (f=0;f<=max; f++){
ComboBox4[d][e][f]=new Array()
}}}
for (g=0; g<=max; g++){
ComboBox5[g]=new Array()
for (h=0; h<=max; h++){
ComboBox5[g][h]=new Array()
for (i=0; i<=max; i++){
ComboBox5[g][h][i]=new Array()
for (j=0; j<=max; j++){
ComboBox5[g][h][i][j]=new Array()
}}}}
for (k=0; k<=max; k++){
ComboBox6[k]=new Array()
for (l=0; l<=max; l++){
ComboBox6[k][l]=new Array()
for (n=0; n<=max; n++){
ComboBox6[k][l][n]=new Array()
for (p=0; p<=max; p++){
ComboBox6[k][l][n][p]=new Array()
for (q=0; q<=max; q++){
ComboBox6[k][l][n][p][q]=new Array()
}}}}}
ComboBox2[0][0]=new Option("---Select Type---"," ");
ComboBox2[1][0]=new Option("Now Select Type"," ");
ComboBox2[1][1]=new Option("Flat","F");
ComboBox2[1][2]=new Option("Tube","T");
ComboBox2[1][3]=new Option("Bar","B");
ComboBox2[2][0]=new Option("Now Select Type"," ");
ComboBox3[0][0][0]=new Option("---Select Group---"," ");
ComboBox3[1][0][0]=new Option("---Select Group---"," ");
ComboBox3[1][1][0]=new Option("Now Select Group"," ");
ComboBox3[1][1][1]=new Option("Plate","P");
ComboBox3[1][1][2]=new Option("Sheet","S");
ComboBox3[1][1][3]=new Option("Mesh","M");
ComboBox3[1][1][4]=new Option("Checker","C");
ComboBox3[1][2][0]=new Option("Now Select Group"," ");
ComboBox3[2][0][0]=new Option("---Select 3---"," ");
ComboBox3[2][1][0]=new Option("Now Select Group"," ");
ComboBox3[2][2][0]=new Option("Now Select Group"," ");
ComboBox4[0][0][0][0]=new Option("---Select ---"," ");
ComboBox4[1][0][0][0]=new Option("---Select ---"," ");
ComboBox4[1][1][1][0]=new Option("Now Select Grade"," ");
ComboBox4[1][1][1][1]=new Option("Mild","M");
ComboBox4[1][1][1][2]=new Option("Rops","R");
ComboBox4[1][1][1][3]=new Option("SS","S");
ComboBox4[2][0][0][0]=new Option("---Select ---"," ");
ComboBox5[0][0][0][0][0]=new Option("---Select ---"," ");
ComboBox5[1][0][0][0][0]=new Option("---Select ---"," ");
ComboBox5[1][1][0][0][0]=new Option("---Select ---"," ");
ComboBox5[1][1][1][0][0]=new Option("Now Select Finish"," ");
ComboBox5[1][1][1][1][0]=new Option("Now Select Finish"," ");
ComboBox5[1][1][1][1][1]=new Option("P&O","P");
ComboBox5[1][1][1][1][2]=new Option("Dry","D");
ComboBox5[1][1][1][1][3]=new Option("Blast","B");
ComboBox6[0][0][0][0][0][0]=new Option("---Select ---"," ");
ComboBox6[1][0][0][0][0][0]=new Option("---Select ---"," ");
ComboBox6[1][1][1][1][0][0]=new Option("Now Select Traceablity"," ");
ComboBox6[1][1][1][1][1][1]=new Option("Yes","Y");
ComboBox6[1][1][1][1][1][2]=new Option("No","N");
/* */
function ReDirect1(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<ComboBox2[x].length;i++){
temp.options[i]=new Option(ComboBox2[x][i].text,ComboBox2[x][i].value)
}
temp.options[0].selected=true
ReDirect2(0)
}
function ReDirect2(y){
var x=document.CBN.CBN1.options.selectedIndex
for (m=temp1.options.length-1;m>0;m--)
temp1.options[m]=null
for (i=0;i<ComboBox3[x][y].length;i++){
temp1.options[i]=new Option(ComboBox3[x][y][i].text,ComboBox3[x][y][i].value)
}
temp1.options[0].selected=true
ReDirect3(0)
}
function ReDirect3(z){
var x=document.CBN.CBN1.options.selectedIndex
var y=document.CBN.CBN2.options.selectedIndex
for (m=temp2.options.length-1;m>0;m--)
temp2.options[m]=null
for (i=0;i<ComboBox4[x][y][z].length;i++){
temp2.options[i]=new Option(ComboBox4[x][y][z][i].text,ComboBox4[x][y][z][i].value)
}
temp2.options[0].selected=true
ReDirect4(0)
}
function ReDirect4(a){
var x=document.CBN.CBN1.options.selectedIndex
var y=document.CBN.CBN2.options.selectedIndex
var z=document.CBN.CBN3.options.selectedIndex
for (m=temp3.options.length-1;m>0;m--)
temp3.options[m]=null
for (i=0;i<ComboBox5[x][y][z][a].length;i++){
temp3.options[i]=new Option(ComboBox5[x][y][z][a][i].text,ComboBox5[x][y][z][a][i].value)
}
temp3.options[0].selected=true
ReDirect5(0)
}
function ReDirect5(b)
{
var x=document.CBN.CBN1.options.selectedIndex
var y=document.CBN.CBN2.options.selectedIndex
var z=document.CBN.CBN3.options.selectedIndex
var a=document.CBN.CBN4.options.selectedIndex
for (m=temp4.options.length-1;m>0;m--)
temp4.options[m]=null
for (i=0;i<ComboBox6[x][y][z][a][b].length;i++){
temp4.options[i]=new Option(ComboBox6[x][y][z][a][b][i].text,ComboBox6[x][y][z][a][b][i].value)
}
temp4.options[0].selected=true
}
function ReDirect6(c)
{
d = document.forms[0];
alert(d.CBN1.value + d.CBN2.value);
}
//-->
</script>
</td>
</tr>
</table>
</FORM>
</font>
</p>
</body>
</html>