Witam. Mam taki podstawowy szkielet strony . Chcę żeby można było wyłączać elementy po kliknięciu na odpowiedni input typu "radio"
co robie nie tak ? Nie interesuje mnie alternatywne rozwiązanie, podejrzewam że można zrobić to ładniej prościej szybciej. Uczę się i chcę się dowiedzieć konkretnie co jest nie tak z moim kodem żeby w przyszłości tego błędu nie popełniać.
<html lang="">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
</head>
<body>
profilowanie wąskie Woodgrain<input Id="profilowanieWaskieWoodgrain" type="radio" name="profil" onclick="profWaskieWoodgrain"><br>
bez profilowań - Gładki<input type="radio" name="profil" Id="bezProfilowanGladki" onclick="profGladki"><br>
mikroprofil<input type="radio" name="profil" Id="mikroprofil" onclick="profMikroprofil"><br>
kaseton Woodgrain<input type="radio" name="profil" Id="kasetonWoodgrain" onclick="profKaseton"><br>
profilowanie Wąskie Gładkie<input type="radio" name="profil" Id="profilowanieWaskieGladkie" onclick="profWaskiGladki"><br>
profilowanie Szerokie Woodgrain<input type="radio" name="profil" Id="profilowanieSzerokieWoodgrain" onclick="profSzerokiWoodgrain"><br>
profilowanie Szerokie Gładkie<input type="radio" name="profil" Id="profilowanieSzerokieGladkie" onclick="profSzerokiGladki"><br><br><br>
kolor standardowy: <input id="kolorStandardowyRadio" type="radio" name="kolor">
<select Id="kolorStandardowyPole">
<option class="a">Wybierz kolor</option>
<option class="b" >Biały 9010</option>
<option class="c" >Złoty Dąb </option>
<option class="d" >Orzech</option>
<option class="e" >Kingchester</option>
<option class="f" >Deep Mat RAL 7016</option>
</select><br>
kolor wg palety RAL: <input id="kolorRalRadio" type="radio" name="kolor">
<input id="kolorRalPole" type="text" name="kolor"><br>
okleina drewnopodobna: <input id="kolorOkleinaRadio" type="radio" name="kolor">
<select id="kolorOkleinaPole" class="okleina">
<option class="1">Wybierz okleinę</option>
<option class="2">Siena Rosso(49233)</option>
<option class="3">Siena Noce(49237)</option>
<option class="4">Winchester(49240)</option>
<option class="5">oregon(1192001)</option>
<option class="6">Ciemny Dąb(2052089)</option>
<option class="7">Jasny Dąb(2052090)</option>
<option class="8">Sapeli(2065021)</option>
<option class="9">Mahoń(2097013)</option>
<option class="10">Oregon(2115008)</option>
<option class="11">Sierra(2167009)</option>
<option class="12">Nevada(2167010)</option>
<option class="13">Sosna Górska(3069041)</option>
<option class="14">Dąb naturalny(3118076)</option>
<option class="15">Dąb Rustykalny(3149008)</option>
<option class="16">Daglezja(3152009)</option>
<option class="17">Dąb(3156003)</option>
<option class="18">Macore(3162002)</option>
<option class="19">Dąb Bagienny(3167004)</option>
<option class="20">Jasny dąb(3167011)</option>
<option class="21">Ciemna wiśnia(3202001)</option>
<option class="22">Dąb irlandzki(3211005)</option>
<option class="23">Dąb antyczny(3211006)</option>
<option class="24">Wiśnia rustykalna(3214007)</option>
</select><br><br>
<script>
function profWaskieWoodgrain() {
document.getElementById("kolorStandardowyRadio").disabled = false;
document.getElementById("kolorStandardowyPole").disabled = false;
document.getElementById("kolorRalRadio").disabled = false;
document.getElementById("kolorRalPole").disabled = false;
document.getElementById("kolorOkleinaRadio").disabled = true;
document.getElementById("kolorOkleinaPole").disabled = true;
}
function profGladki() {
document.getElementById("kolorStandardowyRadio").disabled = false;
document.getElementById("kolorStandardowyPole").disabled = false;
document.getElementById("kolorRalRadio").disabled = false;
document.getElementById("kolorRalPole").disabled = false;
document.getElementById("kolorOkleinaRadio").disabled = false;
document.getElementById("kolorOkleinaPole").disabled = false;
}
function profSzerokiGladki() {
document.getElementById("kolorStandardowyRadio").disabled = false;
document.getElementById("kolorStandardowyPole").disabled = false;
document.getElementById("kolorRalRadio").disabled = true;
document.getElementById("kolorRalPole").disabled = true;
document.getElementById("kolorOkleinaRadio").disabled = true;
document.getElementById("kolorOkleinaPole").disabled = true;
}
function profMikroprofil() {
document.getElementById("kolorStandardowyRadio").disabled = false;
document.getElementById("kolorStandardowyPole").disabled = false;
document.getElementById("kolorRalRadio").disabled = false;
document.getElementById("kolorRalPole").disabled = false;
document.getElementById("kolorOkleinaRadio").disabled = true;
document.getElementById("kolorOkleinaPole").disabled = true;
}
function profKaseton() {
document.getElementById("kolorStandardowyRadio").disabled = false;
document.getElementById("kolorStandardowyPole").disabled = false;
document.getElementById("kolorRalRadio").disabled = false;
document.getElementById("kolorRalPole").disabled = false;
document.getElementById("kolorOkleinaRadio").disabled = true;
document.getElementById("kolorOkleinaPole").disabled = true;
}
function profSzerokiWoodgrain() {
document.getElementById("kolorStandardowyRadio").disabled = false;
document.getElementById("kolorStandardowyPole").disabled = false;
document.getElementById("kolorRalRadio").disabled = false;
document.getElementById("kolorRalPole").disabled = false;
document.getElementById("kolorOkleinaRadio").disabled = true;
document.getElementById("kolorOkleinaPole").disabled = true;
}
function profWaskiGladki() {
document.getElementById("kolorStandardowyRadio").disabled = false;
document.getElementById("kolorStandardowyPole").disabled = false;
document.getElementById("kolorRalRadio").disabled = true;
document.getElementById("kolorRalPole").disabled = true;
document.getElementById("kolorOkleinaRadio").disabled = true;
document.getElementById("kolorOkleinaPole").disabled = true;
}
</script>
</body>
</html>