Danke an Christian Seilert. Jetzt ist leider noch ein 2. Problem
aufgetreten. Und zwar zeigt mir jetzt die NS 4.x - Serie
im Listenfeld "areas" nur eine Option an. Und zwar immer nur die letzte. Vielleicht verrät mir jetzt noch einer, woran das liegt.
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title></title>
</head>
<script language="javascript" >
function caselection(){
var xy= new Array();
var de_areas = new Array();
de_areas["de1"] = "Baden-Württemberg";
de_areas["de2"] = "Bayern";
de_areas["de3"] = "Berlin";
de_areas["de4"] = "Brandenburg";
de_areas["de5"] = "Bremen";
de_areas["de6"] = "Hamburg";
de_areas["de7"] = "Hessen";
de_areas["de8"] = "Mecklenburg-Vorp.";
de_areas["de9"] = "Niedersachsen";
de_areas["de10"]= "Nordrhein-Westfalen";
de_areas["de11"]= "Rheinland-Pfalz";
de_areas["de12"]= "Saarland";
de_areas["de13"]= "Sachsen";
de_areas["de14"]= "Sachsen-Anhalt";
de_areas["de15"]= "Schleswig-Holstein";
de_areas["de16"]= "Thüringen";
var at_areas = new Array();
at_areas["at1"] = "Burgenland";
at_areas["at2"] = "Kärnten";
at_areas["at3"] = "Niederösterreich";
at_areas["at4"] = "Salzburg";
at_areas["at5"] = "Steiermark";
at_areas["at6"] = "Tirol";
at_areas["at7"] = "Vorarlberg";
at_areas["at8"] = "Wien";
var ch_areas = new Array();
ch_areas["ch1"] = "Aargau";
ch_areas["ch2"] = "Appenzell-Ausser-Rhoden";
ch_areas["ch3"] = "Appenzell-Inner-Rhoden";
ch_areas["ch4"] = "Basel-Land";
ch_areas["ch5"] = "Basel-Stadt";
ch_areas["ch6"] = "Bern";
ch_areas["ch7"] = "Fribourg";
ch_areas["ch8"] = "Genf";
ch_areas["ch9"] = "Glarus";
ch_areas["ch10"] = "Graubünden";
ch_areas["ch11"] = "Jura";
ch_areas["ch12"] = "Luzern";
ch_areas["ch13"] = "Neuchatel";
ch_areas["ch14"] = "Nidwalden";
ch_areas["ch15"] = "Obwalden";
ch_areas["ch16"] = "Schaffhausen";
ch_areas["ch17"] = "Schwyz";
ch_areas["ch18"] = "Solothurn";
ch_areas["ch19"] = "St. Gallen]";
ch_areas["ch20"] = "Thurgau";
ch_areas["ch21"] = "Tessin/Ticino";
ch_areas["ch22"] = "Uri";
ch_areas["ch23"] = "Vaud/Waadt";
ch_areas["ch24"] = "Valais/Wallis";
ch_areas["ch25"] = "Zug";
ch_areas["ch26"] = "Zürich";
c=document.forms['CountriesAreasSearch'].elements['country'];
if (c[c.selectedIndex].value=="de"){
counter = 0;
document.CountriesAreasSearch.areas.length = 0;
for (i in de_areas){
alert (de_areas[i]);
NewItem = new Option(de_areas[i],i,false,false);
document.CountriesAreasSearch.areas.options[counter] = NewItem;
counter = counter + 1;
}
}
if (c[c.selectedIndex].value=="at"){
counter = 0;
document.CountriesAreasSearch.areas.length = 0;
for (i in at_areas){
NewItem = new Option(at_areas[i],i,false,false);
document.CountriesAreasSearch.areas.options[counter] = NewItem;
counter = counter + 1;
}
}
if (c[c.selectedIndex].value=="ch"){
counter = 0;
document.CountriesAreasSearch.areas.length = 0;
for (i in ch_areas){
NewItem = new Option(ch_areas[i],i,false,false);
document.CountriesAreasSearch.areas.options[counter] = NewItem;
counter = counter + 1;
}
}
}
</script>
<body bgcolor="#ffffff" >
<form name="CountriesAreasSearch" method="post" action="test.php4">
<select name="country" size="1" onChange="caselection()">
<option value="de">Deutschland</option>
<option value="ch">Schweiz</option>
<option value="at">Österreich</option>
</select>
<br><br>
<select name="areas" size="1"></select>
</form>
</body>
</html>