Witam, ponownie
http://pneumaticon.pl/selet/index.php Chciałbym żeby Ciśnienie i reszta pokazała się dopiero po wybraniu opcji "niewiem"...
<head>
<script type="text/javascript" src="select.js"></script>
</head>
<body>
<form name="formularz" action="wyslanie.php" method="post" >
Średnica Tłoka
<select name='List1' onchange="fillSelect(this.value,this.form['List2'])">
<option selected>Wybierz</option>
</select>
Ciśnienie
<select name='List2' onchange="fillSelect(this.value,this.form['List3'])">
<option selected>Wybierz</option>
</select>
Teoretyczna siła pchająca
<select name='List3' onchange="fillSelect(this.value, this.form['List4'],
this.form['List2'].value)">
<option selected >Wybierz</option>
</select>
Średnica Siłownika
<select name='List4' onchange="getValue(this.value, this.form['List3'])">
</select>
<p><input type="submit" value="Wyślij" /></p>
</form>
</body>
js
var categories = [];
categories["startList"] = ["ϕ8","ϕ10","ϕ12","ϕ16","nie wiem"]
categories["nie wiem"] = ["0,3 bar","0,4 bar","0,5 bar","0,6 bar","0,7 bar","0,8 bar","0,9 bar","1,0 bar"];
categories["0,3 bar"] = ["3 kg","6 kg"," 9 kg","14 kg","24 kg"];
categories["3 kg"] = ["D12"];
categories["6 kg"] = ["D16"];
categories["9 kg"] = ["D20"];
categories["14 kg"] = ["D25"];
categories["24 kg"] = ["D32"];
categories["0,4 bar"] = ["5 kg","8","13", "19","32"];
categories["5 kg"] = ["D12"];
categories["0,5 bar"] = ["6", "10", "15", "24"];
categories["0,6 bar"] = ["7", "12", "19", "30"];
categories["0,7 bar"] = ["8", "14", "22", "35"];
categories["0,8 bar"] = ["9", "16", "26"];
categories["0,9 bar"] = ["11","19","29"];
categories["1,0 bar"] = ["12","20","32"];
var nLists = 4; // number of select lists in the set
function fillSelect(currCat,currList){
var step = Number(currList.name.replace(/\D/g,""));
var nCat = categories[currCat];
var nOption = document.createElement('option');
var nData
= document
.createTextNode
(nCat
[each]); nOption
.setAttribute
('value',nCat
[each]); nOption.appendChild(nData);
currList.appendChild(nOption);
}
}
function init() {
fillSelect('startList',document.forms['formularz']['List1'])
}
navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false);