03.08.2004, 18:20
|
#3
|
|
TP-Senior
Registriert seit: Oct 2001
Ort: Aachen
|
Danke schön!
Ich hatte auch im Kopf gehabt sowas schon mal beim Doktor gesehen zu haben, habs dann aber nicht mehr gefunden.
Ich habs jetzt so gelöst
Zitat:
<html>
<head>
<script type="text/javascript">
var inhalt = new Array();
inhalt[0] = new Array('jeden Tag','alle 2 Tage','D3','D4');
inhalt[1] = new Array('A1','A2','A3');
inhalt[2] = new Array('S1','S2','S3','S4','S5');
function setList(si){
clearList();
var y=parseInt(si-2);
for(var x=0; x<inhalt[y].length; x++){
var pulldown2 = new Option(inhalt[y][x],inhalt[y][x],false,false);
document.form1.pulldown2.options[document.form1.pulldown2.length] = pulldown2;
}
}
function clearList(){
var d = document.form1.pulldown2;
var y = d.length;
for(var x=0; x<y;x++){
d.options[0] = null;
}
}
</script>
</head>
<body>
<form name='form1'>
<select name="pulldown1" onchange="setList(selectedIndex)">
<option value="">Bitte wählen</option>
<option value="" disabled>----------------------</option>
<option value="taeglich">Täglich</option>
<option value="woechentlich">wöchentlich</option>
<option value="monatlich">monatlich</option>
</select>
<select name="pulldown2">
</select>
</form>
</body>
</html>
|
|
|
|