linds415
09-02-2008, 04:27 PM
I'm working to create a triple drop-down menu. So far the first two drop-downs seems to work fine but I'm stuck on the third. None of the options appear when a selection is made from the second drop-down.
Below is my code ... Any help would be greatly appreciated!!
My goal is to have the appropriate video appear under the drop-down menu based on the selections made.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Company Meetings</title>
</head>
<body>
<form name="isc">
<table border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td>
<select name="example" size="1" onchange="redirect(this.options.selectedIndex)">
<option selected="selected">---Select Year-------------</option>
<option>2008</option>
<option>2007</option>
</select>
<select name="stage2" size="1" onchange="redirect1(this.options.selectedIndex)">
<option value=" " selected="selected"> </option>
<option value=" " selected="selected">---Select Month--------------</option>
<option value=" " selected="selected">---Select Month--------------</option>
</select>
<select name="stage3" size="1" onchange="redirect2(this.options.selectedIndex)">
<option value=" " selected="selected"> </option>
<option value=" " selected="selected">---Select Video----------------</option>
<option value=" " selected="selected">---Select Video----------------</option>
</select>
<script type="text/javascript">
var groups=document.isc.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("---Select Month---"," ");
/* 2008 Month Options */
group[1][0]=new Option("March","48");
group[1][1]=new Option("April","47");
group[1][2]=new Option("May","46");
group[1][3]=new Option("June","45");
group[1][4]=new Option("August","44");
/* 2007 Month Options */
group[2][0]=new Option("November","114");
group[2][1]=new Option("December","115");
var temp=document.isc.stage2
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
redirect1(0)
}
var secondGroups=document.isc.stage2.options.length
var secondGroup=new Array(groups)
for (i=0; i<groups; i++) {
secondGroup[i]=new Array(group[i].length)
for (j=0; j<group[i].length; j++) {
secondGroup[i][j]=new Array() }}
secondGroup[0][0][0]=new Option("---Select Video---"," ");
secondGroup[1][0][0]=new Option("---Select Video---"," ");
/* March 2008 */
secondGroup[1][1][0]=new Option("Select Video"," ");
secondGroup[1][1][1]=new Option("Management","");
secondGroup[1][1][2]=new Option("Operations","");
secondGroup[1][1][3]=new Option("Marketing & Task Leads","");
secondGroup[1][1][4]=new Option("Technical","");
secondGroup[1][1][5]=new Option("Slides","");
/*April 2008*/
secondGroup[1][2][0]=new Option("Select Video"," ");
secondGroup[1][2][1]=new Option("Technical"," ");
/*May 2008*/
secondGroup[1][3][0]=new Option("Select Video"," ");
secondGroup[1][3][1]=new Option("Management"," ");
secondGroup[1][3][2]=new Option("Operations","");
secondGroup[1][3][3]=new Option("Marketing","");
secondGroup[1][3][4]=new Option("Task Leads","");
secondGroup[1][3][5]=new Option("Technical","");
/*June 2008*/
secondGroup[1][4][0]=new Option("Select Video"," ");
secondGroup[1][4][1]=new Option("Management"," ");
secondGroup[1][4][2]=new Option("Operations","");
secondGroup[1][4][3]=new Option("Marketing","");
secondGroup[1][4][4]=new Option("Task Leads","");
/* January 2007 */
secondGroup[2][0][0]=new Option("---Select Video---"," ");
secondGroup[2][1][0]=new Option("Select Video"," ");
secondGroup[2][1][1]=new Option("Management"," ");
secondGroup[2][1][2]=new Option("Operations","");
secondGroup[2][1][3]=new Option("Marketing","");
secondGroup[2][1][4]=new Option("Task Leads","");
/* February 2007 */
secondGroup[2][2][0]=new Option("Select Video"," ");
secondGroup[2][2][1]=new Option("Management"," ");
secondGroup[2][2][2]=new Option("Technical","");
var temp1=document.isc.stage3
function redirect1(y){
for (m=temp1.options.length-1;m>0;m--)
temp1.options[m]=null
for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
}
temp1.options[0].selected=true
}
function redirect2(z){
window.location=temp1[z].value
}
//-->
</script>
</td>
</tr>
</table>
</form>
</body>
</html>
Below is my code ... Any help would be greatly appreciated!!
My goal is to have the appropriate video appear under the drop-down menu based on the selections made.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Company Meetings</title>
</head>
<body>
<form name="isc">
<table border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td>
<select name="example" size="1" onchange="redirect(this.options.selectedIndex)">
<option selected="selected">---Select Year-------------</option>
<option>2008</option>
<option>2007</option>
</select>
<select name="stage2" size="1" onchange="redirect1(this.options.selectedIndex)">
<option value=" " selected="selected"> </option>
<option value=" " selected="selected">---Select Month--------------</option>
<option value=" " selected="selected">---Select Month--------------</option>
</select>
<select name="stage3" size="1" onchange="redirect2(this.options.selectedIndex)">
<option value=" " selected="selected"> </option>
<option value=" " selected="selected">---Select Video----------------</option>
<option value=" " selected="selected">---Select Video----------------</option>
</select>
<script type="text/javascript">
var groups=document.isc.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("---Select Month---"," ");
/* 2008 Month Options */
group[1][0]=new Option("March","48");
group[1][1]=new Option("April","47");
group[1][2]=new Option("May","46");
group[1][3]=new Option("June","45");
group[1][4]=new Option("August","44");
/* 2007 Month Options */
group[2][0]=new Option("November","114");
group[2][1]=new Option("December","115");
var temp=document.isc.stage2
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
redirect1(0)
}
var secondGroups=document.isc.stage2.options.length
var secondGroup=new Array(groups)
for (i=0; i<groups; i++) {
secondGroup[i]=new Array(group[i].length)
for (j=0; j<group[i].length; j++) {
secondGroup[i][j]=new Array() }}
secondGroup[0][0][0]=new Option("---Select Video---"," ");
secondGroup[1][0][0]=new Option("---Select Video---"," ");
/* March 2008 */
secondGroup[1][1][0]=new Option("Select Video"," ");
secondGroup[1][1][1]=new Option("Management","");
secondGroup[1][1][2]=new Option("Operations","");
secondGroup[1][1][3]=new Option("Marketing & Task Leads","");
secondGroup[1][1][4]=new Option("Technical","");
secondGroup[1][1][5]=new Option("Slides","");
/*April 2008*/
secondGroup[1][2][0]=new Option("Select Video"," ");
secondGroup[1][2][1]=new Option("Technical"," ");
/*May 2008*/
secondGroup[1][3][0]=new Option("Select Video"," ");
secondGroup[1][3][1]=new Option("Management"," ");
secondGroup[1][3][2]=new Option("Operations","");
secondGroup[1][3][3]=new Option("Marketing","");
secondGroup[1][3][4]=new Option("Task Leads","");
secondGroup[1][3][5]=new Option("Technical","");
/*June 2008*/
secondGroup[1][4][0]=new Option("Select Video"," ");
secondGroup[1][4][1]=new Option("Management"," ");
secondGroup[1][4][2]=new Option("Operations","");
secondGroup[1][4][3]=new Option("Marketing","");
secondGroup[1][4][4]=new Option("Task Leads","");
/* January 2007 */
secondGroup[2][0][0]=new Option("---Select Video---"," ");
secondGroup[2][1][0]=new Option("Select Video"," ");
secondGroup[2][1][1]=new Option("Management"," ");
secondGroup[2][1][2]=new Option("Operations","");
secondGroup[2][1][3]=new Option("Marketing","");
secondGroup[2][1][4]=new Option("Task Leads","");
/* February 2007 */
secondGroup[2][2][0]=new Option("Select Video"," ");
secondGroup[2][2][1]=new Option("Management"," ");
secondGroup[2][2][2]=new Option("Technical","");
var temp1=document.isc.stage3
function redirect1(y){
for (m=temp1.options.length-1;m>0;m--)
temp1.options[m]=null
for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
}
temp1.options[0].selected=true
}
function redirect2(z){
window.location=temp1[z].value
}
//-->
</script>
</td>
</tr>
</table>
</form>
</body>
</html>