Avatar billede hn Nybegynder
15. marts 2003 - 14:21 Der er 5 kommentarer og
1 løsning

Hjælp

Jeg vil høre om der er en der kan,
hjælp mig jeg har fundet det her box system,
men jeg vil meget gerne ha en kasse mere.

hvis ma kan det.

Eks: Spil >> Action >> Battlefield 1942

http://www.scriptbreaker.com/examples/list_created_by_a_list.asp
Avatar billede mortrr Praktikant
15. marts 2003 - 14:37 #1
<html>
<title>Z-Index</title>
<head>
<body>

<!-- Free JavaScripts at http://www.ScriptBreaker.com -->
<html>
<script language = javascript>
var relation = new Array();
relation[0] = new Array("0","Action","0");
relation[1] = new Array("0","D&D","1");
relation[2] = new Array("0","Shooter","2");
relation[3] = new Array("1","Tekst","3");
relation[4] = new Array("1","Grafik","4");
relation[5] = new Array("2","System","5");
relation[6] = new Array("2","Internet","6");
relation[7] = new Array("2","Harddisk","7");

var programs = new Array();
programs[0] = new Array("0","Spil 1","0");
programs[1] = new Array("0","Spil 2","1");
programs[2] = new Array("1","Spil 3","2");
programs[3] = new Array("1","Spil 4","3");
programs[4] = new Array("3","Word 1","4");
programs[5] = new Array("3","Word 2","5");
programs[6] = new Array("4","Grafik 1","6");
programs[7] = new Array("4","Grafik 2","7");

function load_genre(start)
{
    len = relation.length;
    len_box = document.form_select.genre.options.length;
    for (j=len_box;j>=0;j--)
    {
    document.form_select.genre.options[j] = null;
    }
    document.form_select.sPrograms.options.length=0;
    counter = 0;
    for (i=0;i<len;i++)
    {
    if (relation[i][0] == start)
      {
        text = relation[i][1];
        value = relation[i][2];
        document.form_select.genre.options[counter]= new Option(text,value);
        counter++;
      }
    }
}
function load_programs(start)
{
    len = programs.length;
    len_box = document.form_select.sPrograms.options.length;
    for (j=len_box;j>=0;j--)
    {
    document.form_select.sPrograms.options[j] = null;
    }
    counter = 0;
    for (i=0;i<len;i++)
    {
    if (programs[i][0] == start)
      {
        text = programs[i][1];
        value = programs[i][2];
        document.form_select.sPrograms.options[counter]= new Option(text,value);
        counter++;
      }
    }
}
function goToURL() { history.go(-1); }
</script>

<BODY onload="load_genre(0)">
<form name="form_select" ><center>
<select name=group size="5" onchange="load_genre(this.options[this.options.selectedIndex].value)" class="inp" style="width:100">
<option value=0 selected >Spil
<option value=1 >Office
<option value=2 >Utility
</select>
<select name=genre size = "5" onchange="load_programs(this.options[this.options.selectedIndex].value)" class="inp" style="width:100">
</select>
<select name=sPrograms size = "5" class="inp" style="width:100">
</select>
</center>
</form>
</center>
</body>
</html>

<!-- end Source -->


</body>
</html>
Avatar billede hn Nybegynder
16. marts 2003 - 00:29 #2
Det virker ikke der står fejl i linje 76
Avatar billede mortrr Praktikant
16. marts 2003 - 11:54 #3
Højst specielt. Der mangler to afsluttende paranteser, men det er kode som jeg kopierede direkte fra en der virker.

Vi prøver igen:
<html>
<title>Z-Index</title>
<head>
<body>

<!-- Free JavaScripts at http://www.ScriptBreaker.com -->
<html>
<script language = javascript>
var relation = new Array();
relation[0] = new Array("0","Action","0");
relation[1] = new Array("0","D&D","1");
relation[2] = new Array("0","Shooter","2");
relation[3] = new Array("1","Tekst","3");
relation[4] = new Array("1","Grafik","4");
relation[5] = new Array("2","System","5");
relation[6] = new Array("2","Internet","6");
relation[7] = new Array("2","Harddisk","7");

var programs = new Array();
programs[0] = new Array("0","Spil 1","0");
programs[1] = new Array("0","Spil 2","1");
programs[2] = new Array("1","Spil 3","2");
programs[3] = new Array("1","Spil 4","3");
programs[4] = new Array("3","Word 1","4");
programs[5] = new Array("3","Word 2","5");
programs[6] = new Array("4","Grafik 1","6");
programs[7] = new Array("4","Grafik 2","7");

function load_genre(start)
{
    len = relation.length;
    len_box = document.form_select.genre.options.length;
    for (j=len_box;j>=0;j--)
    {
    document.form_select.genre.options[j] = null;
    }
    document.form_select.sPrograms.options.length=0;
    counter = 0;
    for (i=0;i<len;i++)
    {
    if (relation[i][0] == start)
      {
        text = relation[i][1];
        value = relation[i][2];
        document.form_select.genre.options[counter]= new Option(text,value);
        counter++;
      }
    }
}
function load_programs(start)
{
    len = programs.length;
    len_box = document.form_select.sPrograms.options.length;
    for (j=len_box;j>=0;j--)
    {
    document.form_select.sPrograms.options[j] = null;
    }
    counter = 0;
    for (i=0;i<len;i++)
    {
    if (programs[i][0] == start)
      {
        text = programs[i][1];
        value = programs[i][2];
        document.form_select.sPrograms.options[counter]= new Option(text,value);
        counter++;
      }
    }
}
function goToURL() { history.go(-1); }
</script>

<BODY onload="load_genre(0)">
<form name="form_select" ><center>
<select name=group size="5" onchange="load_genre(this.options[this.options.selectedIndex].value)" class="inp" style="width:100">
<option value=0 selected >Spil
<option value=1 >Office
<option value=2 >Utility
</select>
<select name=genre size = "5" onchange="load_programs(this.options[this.options.selectedIndex].value)" class="inp" style="width:100">
</select>
<select name=sPrograms size = "5" class="inp" style="width:100">
</select>
</center>
</form>
</center>
</body>
</html>

<!-- end Source -->


</body>
</html>
Avatar billede mortrr Praktikant
16. marts 2003 - 11:56 #4
"Sjovt" - de forsvinder.

<!-- Free JavaScripts at http://www.ScriptBreaker.com -->
<html>
<script language = javascript>
var relation = new Array();
relation[0] = new Array("0","Action","0");
relation[1] = new Array("0","D&D","1");
relation[2] = new Array("0","Shooter","2");
relation[3] = new Array("1","Tekst","3");
relation[4] = new Array("1","Grafik","4");
relation[5] = new Array("2","System","5");
relation[6] = new Array("2","Internet","6");
relation[7] = new Array("2","Harddisk","7");

var programs = new Array();
programs[0] = new Array("0","Spil 1","0");
programs[1] = new Array("0","Spil 2","1");
programs[2] = new Array("1","Spil 3","2");
programs[3] = new Array("1","Spil 4","3");
programs[4] = new Array("3","Word 1","4");
programs[5] = new Array("3","Word 2","5");
programs[6] = new Array("4","Grafik 1","6");
programs[7] = new Array("4","Grafik 2","7");

function load_genre(start)
{
    len = relation.length;
    len_box = document.form_select.genre.options.length;
    for (j=len_box;j>=0;j--)
    {
    document.form_select.genre.options[j] = null;
    }
    document.form_select.sPrograms.options.length=0;
    counter = 0;
    for (i=0;i<len;i++)
    {
    if (relation[i][0] == start)
      {
        text = relation[i][1];
        value = relation[i][2];
        document.form_select.genre.options[counter]= new Option(text,value);
        counter++;
      }
    }
}
function load_programs(start)
{
    len = programs.length;
    len_box = document.form_select.sPrograms.options.length;
    for (j=len_box;j>=0;j--)
    {
    document.form_select.sPrograms.options[j] = null;
    }
    counter = 0;
    for (i=0;i<len;i++)
    {
    if (programs[i][0] == start)
      {
        text = programs[i][1];
        value = programs[i][2];
        document.form_select.sPrograms.options[counter]= new Option(text,value);
        counter++;
      }
    }
}
function goToURL() { history.go(-1); }
</script>

<BODY onload="load_genre(0)">
<form name="form_select" ><center>
<select name=group size="5" onchange="load_genre(this.options[this.options.selectedIndex].value)" class="inp" style="width:100">
<option value=0 selected >Spil
<option value=1 >Office
<option value=2 >Utility
</select>
<select name=genre size = "5" onchange="load_programs(this.options[this.options.selectedIndex].value)" class="inp" style="width:100">
</select>
<select name=sPrograms size = "5" class="inp" style="width:100">
</select>
</center>
</form>
</center>
</body>
</html>

<!-- end Source -->
Avatar billede mortrr Praktikant
16. marts 2003 - 11:57 #5
Det er de to selects, som har en onchange.
Der skal være en parantes i slutningen af onchange, lige før ":

onchange="load_genre(this.options[this.options.selectedIndex].value)"
onchange="load_programs(this.options[this.options.selectedIndex].value)"
Avatar billede mortrr Praktikant
16. marts 2003 - 11:57 #6
Endelig blev de der.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester