Forum Moderators: open
<html>
<head>
<script language="JavaScript">
nn4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;
function changeForm(form) {
var oSel = eval("form.kategorie");
var userSelection = oSel.options[oSel.selectedIndex].value;
switch (userSelection) {
case "war1" :
if (ie4) {
document.all.Warstwa2Label.style.display = "block";
form.warstwa2.style.display = "block";
document.all.Warstwa3Label.style.display = "block";
form.warstwa3.style.display = "block";
}
if (nn4) {
}
break;
default :
if (ie4) {
document.all.Warstwa2Label.style.display = "none"
form.warstwa2.style.display = "none"
document.all.Warstwa3Label.style.display = "none";
form.warstwa3.style.display = "none";
}
if (nn4) {
}
break;
}
return;
}
</script>
</head>
<body>
<form id="dhtmlForm" action="plik.php" method="post">
<select size="1" id="kategorie" onchange="changeForm(this.form);">
<option name="default" value="default">opcja 0
<option name="warstwa 1" value="war1">opcja 1
<option name="warstwa 2" value="war2">opcja 2
</select>
<br>Opis1<br>
<input type="text" name="cena" size="7" class="input" style="width: 60px;">
<div id="Warstwa2Label" style="display:none;">Opis2
<input name="warstwa2" id="warstwa2_id" type="text" size="7" class="input" style="display:none; width: 60px;">
</div>
<div id="Warstwa3Label" style="display:none;">Opis3
<input name="warstwa3" id="warstwa3_id" type="text" size="7" class="input" style="display:none; width: 60px;">
</div>
</form>
</body>
</html>
<script type="text/javascript" language="JavaScript">
nn4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;function changeForm(form) {
var oSel = eval("form.kategorie");
var userSelection = oSel.options[oSel.selectedIndex].value;
switch (userSelection) {
case "war1" :
if (document.getElementById) {
theElement = document.getElementById("Warstwa2Label");
theElement.style.visibility = "visible";
theElement = document.getElementById("warstwa2");
theElement.style.visibility = "visible";
theElement = document.getElementById("Warstwa3Label");
theElement.style.visibility = "visible";
theElement = document.getElementById("warstwa3");
theElement.style.visibility = "visible";
} else if (ie4) {
document.all.Warstwa2Label.style.visibility = "visible";
form.warstwa2.style.visibility = "visible";
document.all.Warstwa3Label.style.visibility = "visible";
form.warstwa3.style.visibility = "visible";
} else if (nn4) {
theElement=document.layers["Warstwa2Label"];
theElement.visibility = "visible";
theElement=document.layers["warstwa2"];
theElement.visibility = "visible";
theElement=document.layers["Warstwa3Label"];
theElement.visibility = "visible";
theElement=document.layers["warstwa3"];
theElement.visibility = "visible";
}
break;
default :
if (document.getElementById) {
theElement = document.getElementById("Warstwa2Label");
theElement.style.visibility = "hidden";
theElement = document.getElementById("warstwa2");
theElement.style.visibility = "hidden";
theElement = document.getElementById("Warstwa3Label");
theElement.style.visibility = "hidden";
theElement = document.getElementById("warstwa3");
theElement.style.visibility = "hidden";
} else if (ie4) {
document.all.Warstwa2Label.style.visibility = "hidden";
form.warstwa2.style.visibility = "hidden";
document.all.Warstwa3Label.style.visibility = "hidden";
form.warstwa3.style.visibility = "hidden";
} else if (nn4) {
theElement=document.layers["Warstwa2Label"];
theElement.visibility = "hidden";
theElement=document.layers["warstwa2"];
theElement.visibility = "hidden";
theElement=document.layers["Warstwa3Label"];
theElement.visibility = "hidden";
theElement=document.layers["warstwa3"];
theElement.visibility = "hidden";
}
break;
}
return;
}
</script>