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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with selecting

    I know this code is a heap, but it doesnt seem to work. Any ideas/help?

    Code:
    function get_game()
    {
    	var x = 0;
    	var g = document.getElementById("game");
    	var ids = new Array("01 30 9C","03 30 5C","00 30 AC","01 30 1C","24 30 EC","07 30 1C","03 30 8C","04 30 9C","01 30 9C","01 30 8C","02 30 BC","00 30 3C","03 30 14","03 30 7C","01 30 5C","01 30 BC","00 30 84","01 30 9C","01 70 9C","00 30 5C","04 30 3C","06 30 6C","00 30 4C","03 30 3C","01 30 6C","03 30 3C","00 30 6C","02 30 6C","00 30 3C","01 30 44","01 30 8C","01 30 FC","01 30 5C","06 30 6C","01 30 64","01 30 6C","01 30 9C","03 30 54","01 30 54","05 30 94","00 30 24","00 70 24","00 30 74","01 30 1C","00 30 74","06 30 0C","05 30 44","02 30 9C","08 30 1C","00 30 4C","06 30 8C","14 30 44","20 30 84","20 30 B4","01 30 8C","00 30 BC","03 30 CC","0F 30 6C","06 30 44","01 30 BC","02 30 8C","04 30 0C","01 30 14","00 30 64","00 30 44","06 30 64","00 30 EC","02 30 64","07 30 A4","04 30 64","05 30 54","02 30 84","04 30 C4","02 30 BC","01 30 0C","0C 30 0C","01 30 44","0B 30 94","03 30 CC","01 70 9C","03 30 0C","00 30 7C","06 30 64","01 30 4C","03 30 9C","02 30 CC","0A 30 54","03 30 94","01 30 24","0C 30 5C","05 30 9C","01 30 44","01 30 84","02 30 BC","02 30 BC","01 30 8C","00 30 B4","00 30 8C","00 30 8C","05 30 14","00 70 24","02 30 44","00 30 7C","02 30 EC","01 30 54","01 30 6C","00 30 7C","00 30 BC","07 30 4C","01 30 6C","05 30 1C","02 30 FC","04 30 5C","02 30 44","00 30 84","04 30 C4","02 70 9C","05 30 8C","03 30 9C","03 30 64","02 30 A4","03 30 9C","01 30 74","0B 30 B4","00 30 04","10 30 3C","0A 30 7C","00 30 BC","00 30 4C","01 30 EC","02 30 8C","00 30 44","01 30 C4","00 70 CC","00 30 94","04 30 34","02 30 BC");
    	
     var games = new Array("187 Ride or Die (SLUS_211.16)","All-Star Baseball 2005 (SLUS_208.38)","Arc the Lad: End of Darkness (SLUS_211.65)","Area 51 (SLUS_205.95)","ATV Off Road Fury 2 (SCUS_973.69)","ATV Off Road Fury 3 (SCUS_974.05)","Battlefield 2: Modern Combat (SLUS_210.26)","Blitz: The League (SLUS_211.28)","Brothers In Arms: Road to Hill 30 (SLUS_211.63)","Burnout 3: Takedown (SLUS_210.50 / SLUS_207.51)","Burnout: Revenge (SLUS_212.42)","Call Of Duty: Finest Hour (SLUS_207.25)","Champions of Norrath (SLUS_205.65)","Champions: Return to Arms (SLUS_209.73)","Cold Winter (SLUS_208.45)","Conflict Global Terror (SLUS_211.72)",
    "Crash 'N' Burn (SLUS_210.13)","Dance Dance Revolution Xtreme 2 (SLUS_211.74)","Delta Force: Black Hawk Down(SLUS_211.24)","Destruction Derby Arenas (SLUS_208.55)","ESPN College Hoops (SLUS_207.29)","ESPN College Hoops 2K5 (SLUS_209.22)","ESPN Major League Baseball (SLUS_207.94)","ESPN NBA Basketball (SLUS_207.26)","ESPN NBA 2K5 (SLUS_209.20)","ESPN NFL Football (SLUS_207.27)","ESPN NFL 2K5 (SLUS_209.19)","ESPN NHL 2K5 (SLUS_209.21)","ESPN NHL Hockey (SLUS_207.28)","FIFA Soccer 2004 (SLUS_207.50)","FIFA Soccer 2005 (SLUS_210.51)","FIFA 06 (SLUS_212.80)","Fight Club (SLUS_208.57)","Fight Night 2004 - NTSC/USA (SLUS_209.06)","Fight Night Round 2 (SLUS_211.61)","FlatOut (SLUS_209.01)",
    "Full Spectrum Warrior (SLUS_211.45)","Ghost Recon: Jungle Storm","Godzilla: Save the Earth (SLUS 208.09)","GoldenEye: Rogue Agent (SLUS_210.64)","Gretzky NHL 2005 (SCUS_974.09)","Gretzky NHL 2006 (SCUS_974.66)","Heroes of the Pacific (SLUS_209.43)","Hot Shots Golf - Fore! NTSC (SCUS_974.01)","Hot Wheels Stunt Track Challenge (SLUS_209.54)","JAK X Combat Racing (SCUS_974.29)","James Bond 007 : Everything or Nothing (SLUS_207.51)","Juiced (SLUS_20872)","Killzone (SCUS_974.02)","Lord Of The Rings: Return Of The King"
    ,"Lord Of The Rings: The 3rd Age (SLUS_210.27)","Madden NFL 2004 (SLUS_207.52)","Madden NFL 2005 (SLUS_210.0)",
    "Madden NFL 2006 (SLUS_212.13)","Major League Baseball 2K5 (SLUS_210.35)","Major League Baseball 2K5 World Series Edition (SLUS_213.24)","Marvel Nemesis: Rise of the Imperfects (SLUS_212.81)","Metal Gear Solid 3: Snake Eater (SLUS_209.15)","Medal Of Honor: Rising Run (SLUS_207.53)","Midnight Club 2 (SLUS_202.09)","Midnight Club 3: DUB Edition (SLUS_210.29)","MLB 2005","MLB 2006 (SCUS_973.47)","MLB Slugfest: Loaded (SLUS 208.89)","Monster Hunter (SLUS_208.96)"
    ,"Mortal Kombat: Deception (SLUS_208.81)","MTX Mototrax (SLUS_203.99)","MVP Baseball 2004 (SLUS_208.68)","MVP Baseball 2005","MX vs. ATV Unleashed (SLUS_211.04)","Nascar Thunder 2004 (SLUS_208.24)","NASCAR 2005: Chase The Cup","NASCAR 2006: Total Team Control (SLUS_212.66)","NBA 2k6 (SLUS_212.33)","NBA Ballers (SLUS_205.41)","NBA Live 2003 (SLUS_205.36)","NBA Live 2004 (SLUS_207.55)","NBA Live 2005 (SLUS_210.58)","NBA Live 2006 (SLUS_212.79)","NBA Street v3 (SLUS_211.26)","NCAA Basketball 2K3 (SLUS_205.38)","NCAA Football 2005 (SLUS 209.91)","NCAA Football 2006 (SLUS_212.14)","NCAA March Madness 2004 (SLUS_207.71)","NCAA March Madness 2005 (SLUS_211.00)","NCAA March Madness 2006",
    "Need For Speed Underground (SLUS_208.11)","Need For Speed Underground 2 (SLUS_210.65)","NFL Blitz Pro (SLUS_206.31)","NFL Street (SLUS_208.41)","NFL Street 2 (SLUS_211.18)","NHL 2004","NHL 2005 (SLUS_210.01)","NHL 06 (SLUS_212.41)","NHL 2K6 (SLUS_212.34)","Outlaw Golf 2","Outlaw Tennis (SLUS_211.90)","Outlaw Volleyball Remix (SLUS_210.49)","Project Snowblind (SLUS_210.37)","Ratchet And Clank: Crank Up Your Arsenal (SCUS_973.53)","Ratchet: Deadlocked (SCUS_974.65)","Resident Evil Outbreak (SLUS_207.65)","Resident Evil Outbreak File #2 (SLUS_209.84)","Risk Total Domination (SLUS_203.90)","Robotech: Invasion (SLUS_208.23)","Serious Sam: Next Encounter (SLUS_209.07)","S.L.A.I.: Steel Lancer Arena International (SLUS_209.69)","Sniper Elite (SLUS_212.31)",
    "SSX3 (SLUS_207.72)","Star Wars: Battlefront - NTSC/USA (SLUS_208.98)","Street Racing Syndicate (SLUS_205.82)","Syphon Filter: The Omega Strain (SCUS_972.64)","The Sims: Busting Out (SLUS_208.42)","Tiger Woods PGA Tour 2004 (SLUS_207.57)","Tiger Woods PGA Tour 2005 (SLUS 210.02)","Tiger Woods PGA Tour 2006","TimeSplitters: Future Perfect","TOCA Race Driver 2 Ultimate Racing Simulator (SLUS_210.39)","Tom Clancy's Ghost Recon 2 (SLUS_211.05)","Tom Clancy's Rainbow Six 3 (SLUS_208.83)","Tom Clancy's Rainbow Six: Lockdown (SLUS_211.44)","Tom Clancy's Splinter Cell: Chaos Theory (SLUS_211.37)","Tom Clancy's Splinter Cell: Pandora Tommorow (SLUS_209.58)",
    "Tony Hawk's American Wasteland (SLUS 212.08)","Tony Hawk's Pro Skater 4 (SLUS_205.04)","Tony Hawk's Underground (SLUS_207.31)","Tony Hawk Underground 2 (SLUS_209.65)","Top Spin Tennis (SLUS_212.22)","Trivial Pursuit: Unhinged (SLUS_207.91)","Twisted Metal Black Online (SCUS_971.96)","World Championship Poker","World Championship Pool 2004 (SLUS_207.60)","World Poker Tour 2K6 (SLUS_213.33)","World Series of Poker (SLUS_213.01)","WWE: Smackdown Vs Raw (SLUS_210.60)","XIII (SLUS_206.77)","X-Men Legends 2: Rise Of The Apocalypse");
    	
    	while(x<=300)
    	{
    		if(g.selectedIndex == games[x])
    		{
    			alert(games[x],ids[x]);
    			break;
    		} 
    		else {
    			x++;
    			}
    	}
    	
     return;
    }
    Edit:: my games array isnt showing up, i think its too big.
    Last edited by dfsdfdjohn; 04-09-2006 at 06:23 PM.

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,536
    Thanks
    3
    Thanked 513 Times in 500 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
      <title></title>
    <script language="JavaScript" type="text/javascript">
    <!--
    	var x = 0;
    	var g;
    	var ids = new Array("01 30 9C","03 30 5C","00 30 AC","01 30 1C","24 30 EC","07 30 1C","03 30 8C","04 30 9C","01 30 9C","01 30 8C","02 30 BC","00 30 3C","03 30 14","03 30 7C","01 30 5C","01 30 BC","00 30 84","01 30 9C","01 70 9C","00 30 5C","04 30 3C","06 30 6C","00 30 4C","03 30 3C","01 30 6C","03 30 3C","00 30 6C","02 30 6C","00 30 3C","01 30 44","01 30 8C","01 30 FC","01 30 5C","06 30 6C","01 30 64","01 30 6C","01 30 9C","03 30 54","01 30 54","05 30 94","00 30 24","00 70 24","00 30 74","01 30 1C","00 30 74","06 30 0C","05 30 44","02 30 9C","08 30 1C","00 30 4C","06 30 8C","14 30 44","20 30 84","20 30 B4","01 30 8C","00 30 BC","03 30 CC","0F 30 6C","06 30 44","01 30 BC","02 30 8C","04 30 0C","01 30 14","00 30 64","00 30 44","06 30 64","00 30 EC","02 30 64","07 30 A4","04 30 64","05 30 54","02 30 84","04 30 C4","02 30 BC","01 30 0C","0C 30 0C","01 30 44","0B 30 94","03 30 CC","01 70 9C","03 30 0C","00 30 7C","06 30 64","01 30 4C","03 30 9C","02 30 CC","0A 30 54","03 30 94","01 30 24","0C 30 5C","05 30 9C","01 30 44","01 30 84","02 30 BC","02 30 BC","01 30 8C","00 30 B4","00 30 8C","00 30 8C","05 30 14","00 70 24","02 30 44","00 30 7C","02 30 EC","01 30 54","01 30 6C","00 30 7C","00 30 BC","07 30 4C","01 30 6C","05 30 1C","02 30 FC","04 30 5C","02 30 44","00 30 84","04 30 C4","02 70 9C","05 30 8C","03 30 9C","03 30 64","02 30 A4","03 30 9C","01 30 74","0B 30 B4","00 30 04","10 30 3C","0A 30 7C","00 30 BC","00 30 4C","01 30 EC","02 30 8C","00 30 44","01 30 C4","00 70 CC","00 30 94","04 30 34","02 30 BC");
    
     var games = new Array("187 Ride or Die (SLUS_211.16)","All-Star Baseball 2005 (SLUS_208.38)","Arc the Lad: End of Darkness (SLUS_211.65)","Area 51 (SLUS_205.95)","ATV Off Road Fury 2 (SCUS_973.69)","ATV Off Road Fury 3 (SCUS_974.05)","Battlefield 2: Modern Combat (SLUS_210.26)","Blitz: The League (SLUS_211.28)","Brothers In Arms: Road to Hill 30 (SLUS_211.63)","Burnout 3: Takedown (SLUS_210.50 / SLUS_207.51)","Burnout: Revenge (SLUS_212.42)","Call Of Duty: Finest Hour (SLUS_207.25)","Champions of Norrath (SLUS_205.65)","Champions: Return to Arms (SLUS_209.73)","Cold Winter (SLUS_208.45)","Conflict Global Terror (SLUS_211.72)",
    "Crash 'N' Burn (SLUS_210.13)","Dance Dance Revolution Xtreme 2 (SLUS_211.74)","Delta Force: Black Hawk Down(SLUS_211.24)","Destruction Derby Arenas (SLUS_208.55)","ESPN College Hoops (SLUS_207.29)","ESPN College Hoops 2K5 (SLUS_209.22)","ESPN Major League Baseball (SLUS_207.94)","ESPN NBA Basketball (SLUS_207.26)","ESPN NBA 2K5 (SLUS_209.20)","ESPN NFL Football (SLUS_207.27)","ESPN NFL 2K5 (SLUS_209.19)","ESPN NHL 2K5 (SLUS_209.21)","ESPN NHL Hockey (SLUS_207.28)","FIFA Soccer 2004 (SLUS_207.50)","FIFA Soccer 2005 (SLUS_210.51)","FIFA 06 (SLUS_212.80)","Fight Club (SLUS_208.57)","Fight Night 2004 - NTSC/USA (SLUS_209.06)","Fight Night Round 2 (SLUS_211.61)","FlatOut (SLUS_209.01)",
    "Full Spectrum Warrior (SLUS_211.45)","Ghost Recon: Jungle Storm","Godzilla: Save the Earth (SLUS 208.09)","GoldenEye: Rogue Agent (SLUS_210.64)","Gretzky NHL 2005 (SCUS_974.09)","Gretzky NHL 2006 (SCUS_974.66)","Heroes of the Pacific (SLUS_209.43)","Hot Shots Golf - Fore! NTSC (SCUS_974.01)","Hot Wheels Stunt Track Challenge (SLUS_209.54)","JAK X Combat Racing (SCUS_974.29)","James Bond 007 : Everything or Nothing (SLUS_207.51)","Juiced (SLUS_20872)","Killzone (SCUS_974.02)","Lord Of The Rings: Return Of The King"
    ,"Lord Of The Rings: The 3rd Age (SLUS_210.27)","Madden NFL 2004 (SLUS_207.52)","Madden NFL 2005 (SLUS_210.0)",
    "Madden NFL 2006 (SLUS_212.13)","Major League Baseball 2K5 (SLUS_210.35)","Major League Baseball 2K5 World Series Edition (SLUS_213.24)","Marvel Nemesis: Rise of the Imperfects (SLUS_212.81)","Metal Gear Solid 3: Snake Eater (SLUS_209.15)","Medal Of Honor: Rising Run (SLUS_207.53)","Midnight Club 2 (SLUS_202.09)","Midnight Club 3: DUB Edition (SLUS_210.29)","MLB 2005","MLB 2006 (SCUS_973.47)","MLB Slugfest: Loaded (SLUS 208.89)","Monster Hunter (SLUS_208.96)"
    ,"Mortal Kombat: Deception (SLUS_208.81)","MTX Mototrax (SLUS_203.99)","MVP Baseball 2004 (SLUS_208.68)","MVP Baseball 2005","MX vs. ATV Unleashed (SLUS_211.04)","Nascar Thunder 2004 (SLUS_208.24)","NASCAR 2005: Chase The Cup","NASCAR 2006: Total Team Control (SLUS_212.66)","NBA 2k6 (SLUS_212.33)","NBA Ballers (SLUS_205.41)","NBA Live 2003 (SLUS_205.36)","NBA Live 2004 (SLUS_207.55)","NBA Live 2005 (SLUS_210.58)","NBA Live 2006 (SLUS_212.79)","NBA Street v3 (SLUS_211.26)","NCAA Basketball 2K3 (SLUS_205.38)","NCAA Football 2005 (SLUS 209.91)","NCAA Football 2006 (SLUS_212.14)","NCAA March Madness 2004 (SLUS_207.71)","NCAA March Madness 2005 (SLUS_211.00)","NCAA March Madness 2006",
    "Need For Speed Underground (SLUS_208.11)","Need For Speed Underground 2 (SLUS_210.65)","NFL Blitz Pro (SLUS_206.31)","NFL Street (SLUS_208.41)","NFL Street 2 (SLUS_211.18)","NHL 2004","NHL 2005 (SLUS_210.01)","NHL 06 (SLUS_212.41)","NHL 2K6 (SLUS_212.34)","Outlaw Golf 2","Outlaw Tennis (SLUS_211.90)","Outlaw Volleyball Remix (SLUS_210.49)","Project Snowblind (SLUS_210.37)","Ratchet And Clank: Crank Up Your Arsenal (SCUS_973.53)","Ratchet: Deadlocked (SCUS_974.65)","Resident Evil Outbreak (SLUS_207.65)","Resident Evil Outbreak File #2 (SLUS_209.84)","Risk Total Domination (SLUS_203.90)","Robotech: Invasion (SLUS_208.23)","Serious Sam: Next Encounter (SLUS_209.07)","S.L.A.I.: Steel Lancer Arena International (SLUS_209.69)","Sniper Elite (SLUS_212.31)",
    "SSX3 (SLUS_207.72)","Star Wars: Battlefront - NTSC/USA (SLUS_208.98)","Street Racing Syndicate (SLUS_205.82)","Syphon Filter: The Omega Strain (SCUS_972.64)","The Sims: Busting Out (SLUS_208.42)","Tiger Woods PGA Tour 2004 (SLUS_207.57)","Tiger Woods PGA Tour 2005 (SLUS 210.02)","Tiger Woods PGA Tour 2006","TimeSplitters: Future Perfect","TOCA Race Driver 2 Ultimate Racing Simulator (SLUS_210.39)","Tom Clancy's Ghost Recon 2 (SLUS_211.05)","Tom Clancy's Rainbow Six 3 (SLUS_208.83)","Tom Clancy's Rainbow Six: Lockdown (SLUS_211.44)","Tom Clancy's Splinter Cell: Chaos Theory (SLUS_211.37)","Tom Clancy's Splinter Cell: Pandora Tommorow (SLUS_209.58)",
    "Tony Hawk's American Wasteland (SLUS 212.08)","Tony Hawk's Pro Skater 4 (SLUS_205.04)","Tony Hawk's Underground (SLUS_207.31)","Tony Hawk Underground 2 (SLUS_209.65)","Top Spin Tennis (SLUS_212.22)","Trivial Pursuit: Unhinged (SLUS_207.91)","Twisted Metal Black Online (SCUS_971.96)","World Championship Poker","World Championship Pool 2004 (SLUS_207.60)","World Poker Tour 2K6 (SLUS_213.33)","World Series of Poker (SLUS_213.01)","WWE: Smackdown Vs Raw (SLUS_210.60)","XIII (SLUS_206.77)","X-Men Legends 2: Rise Of The Apocalypse");
    function initgame(){
      g = document.getElementById("game");
      for (var zxc0=0;zxc0<games.length;zxc0++){
       g.options[zxc0]=new Option(games[zxc0],games[zxc0],true,true);
      }
    }
    
    function get_game(){
     while(x<games.length){
      if(g.value == games[x])	{
       alert(games[x]+'\n'+ids[x]);
       break;
      }
      else {
       x++;
      }
     }
     return;
    }
    //-->
    </script></head>
    
    <body onload="initgame();" >
    <select id="game" onchange="get_game()"></select>
    </body>
    
    </html>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/


  •  

    Posting Permissions

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