Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Triple Drop-Down

    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.

    Code:
    <!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> &nbsp;
    
    <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>
    Last edited by linds415; 09-03-2008 at 02:42 PM. Reason: Resolved

  • #2
    Banned
    Join Date
    May 2005
    Location
    Midwest, U.S.
    Posts
    118
    Thanks
    1
    Thanked 26 Times in 23 Posts
    No. I won't go outside the forum.
    Last edited by Cranford; 09-02-2008 at 07:22 PM.

  • #3
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    See web page....

    This is how the web page describes to use the code and it works fine until you get to my third drop-down. When I made changes to the options I'm not sure what got messed up because if you copy the code from the web page and save it as a html page it works just fine.

    http://www.wsabstract.com/script/scr...plecombo.shtml

  • #4
    Banned
    Join Date
    May 2005
    Location
    Midwest, U.S.
    Posts
    118
    Thanks
    1
    Thanked 26 Times in 23 Posts
    No. I won't go outside the forum. I DID help. I posted code, but you ignored it, so I deleted it. You have no trouble posting links, but can't bring yourself to write a simple "thanks for responding."
    Last edited by Cranford; 09-02-2008 at 07:24 PM.

  • #5
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thank you for responding however....

    I'm a little confused by your short and abrupt responses .... it really doesn't seem like you want to help ... which is fine. I'm not sure why you won't go outside the forum to better understand why I did it the way I did considering your remark about the <script> listed within the <body> and the fact that I was directed to these forums from the web page link I posted.

    ~~~~~

    If anyone has the time to look at this and help guide me I would appreciate it! I just want to understand where I went wrong .... thanks again!!

  • #6
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I never saw any code listed in response to my question! Maybe if you had given me a chance to look at it I would have been able to thank you.

    Last post I SAW was the one comment about where in my code I had included the script. I replied with the link and then saw the rude posts. If you did take the time to look and post a helpful reply ... thank you! However, the short/rude response and removal of code before I even had a chance to read them was unnecessary. Since not everyone has time to sit and stare at their forum posts maybe next time you should give someone a chance before "jumping the gun" and making accusations about how grateful someone can be when receiving help.

    Sorry! but NO you DIDN'T help me.

    Fortunately I was able to figure this out on my own and now have working drop-downs.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •