Web Analytics Made Easy -
StatCounter New double combo box problem - CodingForum

Announcement

Collapse
No announcement yet.

New double combo box problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • New double combo box problem

    Remember that "double combo box music selector" (http://codingforum.net/showthread.php?threadid=33350 ) problem I had before? Well, now I have a new problem. You see, it worked for a while but one time, after adding a few songs, it stopped working. I got the the "object expected" error. When I removed the most recently inserted songs, it worked, so I made them a sperate list. All lists, including the most recent set of songs, work independantly. What happens is the second box values will not change. Here is the code:



    Code:
    <html><head>
    
    <script type="text/javascript">
    <!--hide
    function dip() {
    var it=document.doublecombo.stage2.options[document.doublecombo.stage2.selectedIndex].value;
    alert('i '+it+' o');
    var oIFrame = document.getElementById('TheW'),
     oFramedDoc = typeof oIFrame.contentDocument != 'undefined'?
     oIFrame.contentDocument: // W3C way
     typeof oIFrame.contentWindow != 'undefined'?
     oIFrame.contentWindow.document: // Microsoft way
     typeof oIFrame.document != 'undefined'?
     oIFrame.document: // Traditional way
     null; // And no way.
     if(oFramedDoc != null){
     oFramedDoc.open();
     oFramedDoc.write('o   HIDDEN=true <embed controls="largeconsole" src="'+it+'" autostart="false" loop="true" volume="50%" height="245" width="185" align=CENTER> i'); } 
    }
    
    //-->
    </script>
    
    </head><body bgcolor=royalblue>
    
    <iframe id="TheW" width=355 height=275></iframe>
    
    <input type="button" value="dooit" onClick="dip()">
    <form name="doublecombo">
    <p><select name="example" size="1" onChange="redirect(this.options.selectedIndex)">
    <option>MIDIs</option>
    <option>MIDIs22</option>
    <option>WAVs</option>
    <option>Videoss</option>
    <option selected>CHOOSE ONE</option>
    </select>
    <select name="stage2" size="1">
    <option value="">&lt Select one</option>
    
    </select>
    <input type="button" name="test" value="Go!"
    onClick="go()">
    </p>
    
    <script language="javascript" type="text/javascript">
    <!--
    
    /*
    Double Combo Script Credit
    By JavaScript Kit ([url]www.javascriptkit.com[/url])
    Over 200+ free JavaScripts here!
    */
    
    var groups=document.doublecombo.example.options.length
    var group=new Array(groups)
    for (i=0; i<groups; i++)
    group[i]=new Array()
    
    group[0][0]=new Option("99Luft~1","99LUFT~1.mid")
    group[0][1]=new Option("1812OVT","MIDFILES\\1812OVT.mid")
    group[0][2]=new Option("About","about.mid")
    group[0][3]=new Option("Action1","MIDFILES\\ACTION1.mid")
    group[0][4]=new Option("ACTION3","MIDFILES\\ACTION3.mid")
    group[0][5]=new Option("Spiders","Attackofthespiders.mid")
    group[0][6]=new Option("bgMusic1","JYU\\JKUILYOTOV\\bgmusic1.mid")
    group[0][7]=new Option("bgMusic2","JYU\\JKUILYOTOV\\bgmusic2.mid")
    group[0][8]=new Option("bgMusic7","JYU\\JKUILYOTOV\\bgmusic3.mid")
    group[0][9]=new Option("Bluesy2","MIDFILES\\BLUESY2.mid")
    group[0][10]=new Option("bx","JYU\\JKUILYOTOV\\bx.mid")
    group[0][11]=new Option("Cant2","Cant2.mid")
    group[0][12]=new Option("Cantina","cantina.mid")
    group[0][13]=new Option("Cantina2","Cantina2.mid")
    group[0][14]=new Option("Canyon (SUPER SHEL)g","Canyon.mid")
    group[0][15]=new Option("Cavalry","MIDFILES\\CAVALRY.mid")
    group[0][16]=new Option("Chopin","JYU\\JKUILYOTOV\\chopin_piano_concertos_opus21_no2.mid")
    group[0][17]=new Option("EINKLEIN","MIDFILES\\EINKLEIN.mid")
    group[0][18]=new Option("Fanfare","New Folder\\FANFARE1.mid")
    group[0][19]=new Option("FireMusi","MIDFILES\\FIREMUSI.mid")
    group[0][20]=new Option("Funk2","MIDFILES\\FUNK2.mid")
    group[0][21]=new Option("FUNK3","MIDFILES\\FUNK3.mid")
    group[0][22]=new Option("GROOVE","MIDFILES\\GROOVE.mid")
    group[0][23]=new Option("IMAGE1","MIDFILES\\IMAGE1.mid")
    group[0][24]=new Option("Image2","MIDFILES\\IMAGE2.mid")
    group[0][25]=new Option("ISLAND","MIDFILES\\ISLAND.mid")
    group[0][26]=new Option("Itshopy","MIDFILES\\ITSHOP.mid")
    group[0][27]=new Option("JAZZ3","MIDFILES\\JAZZ3.mid")
    group[0][28]=new Option("KOOLTHINGUY","MIDFILES\\KOOLTHIN.mid")
    group[0][29]=new Option("LISZT22","MIDFILES\\LISZT2.mid")
    group[0][30]=new Option("MIDI!","New Folder\\MIDI1.mid")
    group[0][31]=new Option("MOOD5","MIDFILES\\MOOD5.mid")
    group[0][32]=new Option("Musdat01","New Folder\\Musdat01.mid")
    group[0][33]=new Option("Musdat02","New Folder\\Musdat02.mid")
    group[0][34]=new Option("Musdat03","New Folder\\Musdat03.mid")
    group[0][35]=new Option("Musdat04","New Folder\\Musdat04.mid")
    group[0][36]=new Option("Musdat05","New Folder\\Musdat05.mid")
    group[0][37]=new Option("Musdat06","New Folder\\Musdat06.mid")
    group[0][38]=new Option("Musdat07","New Folder\\Musdat07.mid")
    group[0][39]=new Option("Passport","PASSPORT.mid")
    group[0][40]=new Option("B1","B1.rmi")
    group[0][41]=new Option("B2","B2.rmi")
    group[0][42]=new Option("M1","M1.rmi")
    group[0][43]=new Option("Serenity","MIDFILES\\SERENITY.mid")
    group[0][44]=new Option("Short03","New Folder\\Short03.mid")
    group[0][45]=new Option("SHORT078","New Folder\\Short08.mid")
    group[0][46]=new Option("Sontina3","MIDFILES\\SONTINA3.mid")
    group[0][47]=new Option("Staccato","MIDFILES\\STACCATO.mid")
    group[0][48]=new Option("Techno1","MIDFILES\\TECHNO1.mid")
    group[0][49]=new Option("TIM","New Folder\\TIM_.mid")
    
    
    group[1][0]=new Option("TIM BLUZ","New Folder\\TIM_BLUZ.mid")
    group[1][1]=new Option("TIM CLAS","New Folder\\TIM_CLAS.mid")
    group[1][2]=new Option("TIM CRBN","New Folder\\TIM_CRBN.mid")
    group[1][3]=new Option("TIM CRUZ","New Folder\\TIM_CRUZ.mid")
    group[1][4]=new Option("TIM EAST","New Folder\\TIM_EAST.mid")
    group[1][5]=new Option("TIM EURO","New Folder\\TIM_EURO.mid")
    group[1][6]=new Option("TIM FUNKGHGH","New Folder\\TIM_FUNK.mid")
    group[1][7]=new Option("TIM FUSNGHGH","New Folder\\TIM_FUSN.mid")
    group[1][8]=new Option("TIM JNGL","New Folder\\TIM_JNGL.mid")
    group[1][9]=new Option("TIM METL","New Folder\\TIM_METL.mid")
    group[1][10]=new Option("TIM MILR,"New Folder\\TIM_MILR.mid")
    group[1][11]=new Option("TIM PLKA","New Folder\\TIM_PLKA.mid")
    group[1][12]=new Option("TIM REGG","New Folder\\TIM_REGG.mid")
    group[1][13]=new Option("TIM RMNT","New Folder\\TIM_RMNT.mid")
    group[1][14]=new Option("TIM ROCK","New Folder\\TIM_ROCK.mid")
    group[1][15]=new Option("TIM ROK2","New Folder\\TIM_ROK2.mid")
    group[1][16]=new Option("TIM SLSA","New Folder\\TIM_SLSA.mid")
    group[1][17]=new Option("TIM SPLN","New Folder\\TIM_SPLN.mid")
    group[1][18]=new Option("TIM WEST","New Folder\\TIM_WEST.mid")
    group[1][19]=new Option("TIM ZYDI","New Folder\\TIM_.mid")
    group[1][20]=new Option("TURKISH","MIDFILES\\TURKISH.mid")
    group[1][21]=new Option("WALTZFGGHHLR","MIDFILES\\WALTZFLR.mid")
    group[1][22]=new Option("WILLTELL","MIDFILES\\WILLTELL.mid")
    
    
    
    
    group[2][0]=new Option("MUSIC11","22.WAV")
    group[2][1]=new Option("MUSIC22","27.WAV")
    
    
    
    
    
    
    group[3][0]=new Option("MC1","0908MOV.avi")
    group[3][1]=new Option("MC2","1056MOV.avi")
    group[3][2]=new Option("MC3","1067MOV.avi")
    group[3][3]=new Option("Yahoo","yahoo!.avi")
    group[3][4]=new Option("AlienSong","aliensong.mpg")
    
    group[4][0]=new Option("\< Pick one","")
    
    var temp=document.doublecombo.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
    }
    
    function go(){
    location=temp.options[temp.selectedIndex].value
    }
    //-->
    </script>
    
    </form>
    
    <p align="center"><font face="arial" size="-2">This free script provided by</font><br>
    <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
    Kit</a></font></p>
    <p align="center"><font face="arial" size="-2">This free script provided by</font><br>
    <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
    Kit</a></font></p>
    
    
    
    
    
    </body></html>
    It can not be in the most recently added list itself because it works independantly. What is the problem? (Thanks in advance!)
    Last edited by Bobo; Feb 22, 2004, 05:19 PM.
    Oh, was I supposed to put something here? ........
Working...
X