Hallo zusammen!
ich habe eine Auswahlliste und möchte daraus einige Einträge löschen, welche Einträge gelöscht werden hängen von dem Wert eines Eingabefeldes ab.
Hab in selfHTML gesucht und bin auch fündig geworden, dass man mit
document.spiel.wahl.options[3] = null;
z.B einen Eintrag entfernen kann. Danach hab ich mein Script aufgebaut:
function menge()
{
window.document.spiel.level.value = opener.document.auswertung.level.value;
var x = window.document.spiel.level.value;
switch(x)
{
case "1":
document.spiel.wahl.options[3] = null;
document.spiel.wahl.options[4] = null;
document.spiel.wahl.options[5] = null;
document.spiel.wahl.options[6] = null;
break;
case "2":
document.spiel.wahl.options[4] = null;
document.spiel.wahl.options[5] = null;
document.spiel.wahl.options[6] = null;
break;
}
}
aber irgendwas scheint da falsch zu sein. Wenn x den Wert "1" hat, dann werden .options [3] und .options [5] gelöscht, [4] und [6] hingegen nicht. woran kann das liegen? Danke!
life's for the living. so check me tomorrow [Matthew Good Band]