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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
<form name="doublecombo" >
<p>
<select name="example" size="1" onChange="redirect(this.options.selectedIndex)">
<option>A</option>
<option>B</option>
<option>C</option>
</select>
<select name="stage2" size="1">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
</p>
<p><select name="example1" size="1" onChange="redirect(this.a.options.selectedIndex)">
<option>A</option>
<option>B</option>
<option>C</option>
</select>
<select name="stage3" size="1">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
</p>
<script>
var groups=document.doublecombo.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("1","1")
group[0][1]=new Option("2","2")
group[0][2]=new Option("3","3")
group[1][0]=new Option("2","2")
group[1][1]=new Option("21","21")
group[2][0]=new Option("3","3")
group[2][1]=new Option("3","3")
group[2][2]=new Option("3","3")
group[2][3]=new Option("3","3")
var temp=document.doublecombo.stage2
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
}
</script>
<script>
var groups=document.doublecombo.example1.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("1","1")
group[0][1]=new Option("2","2")
group[0][2]=new Option("3","3")
group[1][0]=new Option("2","2")
group[1][1]=new Option("21","21")
group[2][0]=new Option("3","3")
group[2][1]=new Option("3","3")
group[2][2]=new Option("3","3")
group[2][3]=new Option("3","3")
var temp=document.doublecombo.stage3
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
}
</script>
</form> |
Partager