1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
<title>Test</title>
<script type="text/javascript">
// listes deroulantes
var Level1 = new Array("Pièce de théatre","Chemicals","concert","improvisation");
var Ceramics = new Array("ELECTRONICS","ENVIRONMENTAL");
var Chemicals = new Array("METALLIC SOAPS","OLEOCHEMICAL_DERIVATIVES");
var ELECTRONICS = new Array("Solder mask");
var ENVIRONMENTAL = new Array("Catalysts");
var METALLICSOAPS = new Array("Soap","Translucent soaps","Liquid soap");
var OLEOCHEMICAL_DERIVATIVES = new Array("FA-pos","FA polfaideriv");
// remplissage Select
function fillSelect(isValue,isNext){
var isValue;
var isNext = document.getElementById(isNext);
isNext.style.display = "";
isNext.length = 1;
var tableau = window[isValue.replace(/\s/g,'')];
for (var zxc0=0; zxc0<tableau.length; zxc0++) {
isNext.options[zxc0+1] = new Option(tableau[zxc0],tableau[zxc0],true,true);
}
isNext.selectedIndex = 0;
}
function initselect() {
document.getElementById('idList2').style.display = "none";
document.getElementById('idList3').style.display = "none";
// remplissage Select List1
fillSelect('Level1','idList1');
}
function getValue(isValue){
}
</script>
</head>
<body onload="initselect();">
<div style="text-align:center;">
<h4>Dependent Select List, within a form</h4>
<form method="post" action="">
<p>Industry segment
<select id="idList1" name="List1" onchange="fillSelect(this.value,'idList2');">
<option selected="selected">Make a selection</option>
</select>
<p>
</p>
<select id="idList2" name="List2" onchange="fillSelect(this.value,'idList3');">
<option selected="selected">Make a selection</option>
</select>
<p>
</p>
<select id="idList3" name="List3" onchange="getValue(this.value);">
<option selected="selected">Make a selection</option>
</select>
</p>
</form>
</div>
</body>
</html> |
Partager