<script type="text/javascript">
function synchronize_select(){
var selected = document.getElementById("select1").value;
select1 += '</select>';
switch( selected ){case "1": var select1 = '<select name="select2" id="select2">';
select1 += '<option value="0">-XXX wählen-</option>';variable2 ="XXX";select1 += '<option value="1" id="select3">XXX</option>';document.getElementById ("selectdiv").innerHTML = select1;
break;
case "2": var select1 = '<select name="select2" id="select2">';
select1 += '<option value="0">-XXX wählen-</option>'; variable2 ="XXX";
select1 += '<option value="2" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="3" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="4" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="5" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="6" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="56" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="62" id="select3">XXX</option>';
document.getElementById("selectdiv").innerHTML = select1;
break;
case "3": var select1 = '<select name="select2" id="select2">';
select1 += '<option value="0">-XXX wählen-</option>';variable2 ="XXX";
select1 += '<option value="7" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="8" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="9" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="10" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="57" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="63" id="select3">XXX</option>';
document.getElementById("selectdiv").innerHTML = select1;
break;
case "4": var select1 = '<select name="select2" id="select2">';
select1 += '<option value="0">-XXX wählen-</option>';variable2 ="XXX";
select1 += '<option value="11" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="12" id="select3">XXX</option>';variable2 ="XXX";
select1 += '<option value="68" id="select3">XXX</option>';
document.getElementById("selectdiv").innerHTML = select1;
break;
default:
break;
}
}
function synchronize_select2(){
var selected2 = document.getElementById("select2").value;
switch( selected2 ){case "1": variable1 = "XXX";
document.getElementById("name").value = variable1+', '+variable2;
break;case "2": variable1 = "XXX";
document.getElementById("name").value = variable1+', '+variable2;
break;case "3": variable1 = "XXX";
document.getElementById("name").value = variable1+', '+variable2;
break;
default:
document.getElementById("name").value = '';
break;
}
}
</script><body onload="synchronize_select()">
<p>
<select name="select1" id="select1" onchange="synchronize_select()">
<option value="0">-XXX wählen-</option>
<option value="1">XXXoption>
<option value="2">XXX</option>
<option value="3">XXX</option></<select>
<div id="selectdiv" onchange="synchronize_select2()">
<select name="select2" id="select2">
</select>
</div>
</p>
</body>