Værsgo!
<script type="text/javascript">
var areas = new Array();
var area_0 = new Array();
area_0[0] = "Café Ministeriet|Ministeriet";
area_0[1] = "Café Vesterå|Vesterå";
area_0[2] = "Hr Nielsen|Nielsen";
area_0[3] = "Saltlageret|Saltlageret";
areas[0] = area_0;
var area_1 = new Array();
area_1[0] = "Bridgewater|Bridgewater";
area_1[1] = "Café Faust|Faust";
area_1[2] = "Café Kindrødt|Kindrødt";
area_1[3] = "Kupé|Kupe";
areas[1] = area_1;
var area_2 = new Array();
area_2[0] = "Café Sommerbio|Sommerbio";
area_2[1] = "Jazzhouse|Jazzhouse";
area_2[2] = "Rosie Mcgee|RosieMcgee";
area_2[3] = "Zeze|Zeze";
areas[2] = area_2;
var area_3 = new Array();
area_3[0] = "Café Biografen|Biografen";
area_3[1] = "Café Froggys|Froggys";
area_3[2] = "Cuckoo's Nest|CuckoosNest";
area_3[3] = "Franck A|FranckA";
areas[3] = area_3;
function showOptions(oThis, sTarget, aArr){
oTarget = document.getElementById(sTarget);
if (oThis && aArr && oTarget){
oTarget.options.length = 1;
for (i=0; i<aArr[oThis.value].length; i++){
sNewOption = document.createElement("OPTION");
oNewText = document.createTextNode(aArr[oThis.value][i].split("|")[0]);
sNewOption.setAttribute("value", aArr[oThis.value][i].split("|")[1]);
sNewOption.appendChild(oNewText);
oTarget.appendChild(sNewOption);
}
}
}
</script>
<select name="city" id="city" onchange="if (this.selectedIndex != 0)
showOptions(this, 'cafe', areas);">
<option value="">[Vælg By]</option>
<option value="0" >Aalborg</option>
<option value="1" >Århus</option>
<option value="2" >København</option>
<option value="3" >Odense</option>
</select>
<select name="cafe" id="cafe">
<option value="">[Vælg en favorit café]</option>
</select>
mvh
Thomas Fagerholt
---------------------------------------------------------
profilEdit CMS - Online demo på
http://demo.profiledit.dk