Das Beispiel funktioniert in FireFox und Opera einwandfrei. nur der IE spielt nicht mit.
Ziel ist es nur mittel angewählten Radio-buttons Element ausgrauen.
Gibs vielleicht ne bessere Lösung ?
Dank im Vorraus ;)
<style type="text/css">
.text1 {
color:#999999;
text-align:left;
}
</style>
<br>
<form action="upload.php" method="get" name="formname">
<p class="text1">
Auswahl 1
<input onclick="javascript:select_target_1()" type="radio" value="set_mygallerie" name="select_set" id="radio_add_gal">
<select id="id_select_gal" name="name_select_gal">
<option>Option 1</option> </select>
</p>
<p class="text1">Auswahl 2
<input onclick="javascript:select_target_2()" type="radio" value="set_newgallerie" name="select_set" id="radio_new_gal">
<input type="text" name="new_gal_name" maxlength="50" id="id_input_newgal">
Kategorie: <select name="name_select_inkat" id="id_select_inkat">
<option>Option 1</option><option>Option 2</option><option>Option 3</option><option>Option 4</option></select>
</p>
<p class="text1">Auswahl 3
<input onclick="javascript:select_target_3()" type="radio" value="set_onepic" name="select_set" id="radio_one_pic">
Kategorie: <select name="name_select_kat" id="id_select_kat">
<option>Option 1</option><option>Option 2</option><option>Option 3</option><option>Option4</option></select>
</p>
</form>
<script type="text/javascript">
setdisabledidselectgal = document.createAttribute("disabled");
setdisabledidselectgal.nodeValue = "disabled";
setdisabledidinputnewgal = document.createAttribute("disabled");
setdisabledidinputnewgal.nodeValue = "disabled";
setdisabledidselectinkat = document.createAttribute("disabled");
setdisabledidselectinkat.nodeValue = "disabled";
setdisabledidselectkat = document.createAttribute("disabled");
setdisabledidselectkat.nodeValue = "disabled";
function select_target_1(){
document.getElementById("id_input_newgal").setAttributeNode(setdisabledidinputnewgal);
document.getElementById("id_select_inkat").setAttributeNode(setdisabledidselectinkat);
document.getElementById("id_select_kat").setAttributeNode(setdisabledidselectkat);
document.getElementById("id_select_gal").removeAttribute("disabled");
}
function select_target_2() {
document.getElementById("id_select_gal").setAttributeNode(setdisabledidselectgal);
document.getElementById("id_select_kat").setAttributeNode(setdisabledidselectkat);
document.getElementById("id_input_newgal").removeAttribute("disabled");
document.getElementById("id_select_inkat").removeAttribute("disabled");
}
function select_target_3(){
document.getElementById("id_select_gal").setAttributeNode(setdisabledidselectgal);
document.getElementById("id_input_newgal").setAttributeNode(setdisabledidinputnewgal);
document.getElementById("id_select_inkat").setAttributeNode(setdisabledidselectinkat);
document.getElementById("id_select_kat").removeAttribute("disabled");
}
</script>