J'aimerai créer un champ avec le code suivant :
<FORM name="isc" class="pays-ville">
<table border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td nowrap class="pays-ville">
<select name="example" size="1" onChange="redirect(this.options.selectedIndex)">
<option selected>Pays/Country</option>
<option>France</option>
<option>Germany</option>
<option>Italy</option>
<option>Spain</option>
<option>England</option>
<option>Ireland</option>
<option>United States</option>
</select>
<select name="stage2" size="1" onChange="redirect1(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>Ville/City</option>
</select>
<select name="stage3" size="1" onChange="redirect2(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>Piscine/Swimming pool</option>
</select>
<script>
<!--
var groups=document.isc.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("Ville/City"," ");
group[1][0]=new Option("Now Select This One"," ");
group[1][1]=new Option("Trouville/mer","47");
group[1][2]=new Option("Vire","46");
group[1][3]=new Option("Le Havre","45");
group[1][4]=new Option("Rouen","44");
group[1][5]=new Option("Caen","43");
group[2][0]=new Option("Now Select This One"," ");
group[2][1]=new Option("Berlin","115");
group[2][2]=new Option("Stutgart","116");
group[3][0]=new Option("Now Select This One"," ");
group[3][1]=new Option("Roma","115");
group[3][2]=new Option("Firenze","116");
group[7][0]=new Option("Now Select This One"," ");
group[7][1]=new Option("New York","115");
var temp=document.isc.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
redirect1(0)
}
var secondGroups=document.isc.stage2.options.length
var secondGroup=new Array(groups)
for (i=0; i<groups; i++) {
secondGroup[i]=new Array(group[i].length)
for (j=0; j<group[i].length; j++) {
secondGroup[i][j]=new Array() }}
secondGroup[0][0][0]=new Option("---Select 3---"," ");
secondGroup[1][0][0]=new Option("---Select 3---"," ");
secondGroup[1][1][0]=new Option("Now Select This One"," ");
secondGroup[1][1][1]=new Option("piscine de Trouville","#");
secondGroup[1][2][0]=new Option("Now Select This One"," ");
secondGroup[1][2][1]=new Option("piscine de Vire","#");
secondGroup[1][3][0]=new Option("Now Select This One"," ");
secondGroup[1][3][1]=new Option("piscine du Havre","#");
secondGroup[1][4][0]=new Option("Now Select This One"," ");
secondGroup[1][4][1]=new Option("piscine de Rouen","#");
secondGroup[1][5][0]=new Option("Now Select A Page"," ");
secondGroup[1][5][1]=new Option("piscine de Caen","#");
secondGroup[2][0][0]=new Option("---Select 3---"," ");
secondGroup[2][1][0]=new Option("Now Select This One"," ");
secondGroup[2][1][1]=new Option("Berlin pool 1","#");
secondGroup[2][1][0]=new Option("Now Select This One"," ");
secondGroup[2][1][1]=new Option("Berlin pool 1","#");
secondGroup[2][1][0]=new Option("Now Select This One"," ");
secondGroup[2][1][2]=new Option("Berlin pool 2","#");
secondGroup[2][1][0]=new Option("Now Select This One"," ");
secondGroup[2][1][3]=new Option("Berlin pool 3","#");
secondGroup[7][0][0]=new Option("---Select 3---"," ");
secondGroup[7][1][0]=new Option("Now Select This One"," ");
secondGroup[7][1][1]=new Option("Metropolitan pool","#");
var temp1=document.isc.stage3
function redirect1(y){
for (m=temp1.options.length-1;m>0;m--)
temp1.options[m]=null
for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
}
temp1.options[0].selected=true
}
function redirect2(z){
window.location=temp1[z].value
}
//-->
</script>
</td>
</tr>
</table>
</FORM>
Le problème est que lorsque je sélectionne le niveau1 du menu (les pays),
et bien je ne peux pas sélectionner le niveau2 (les villes) et bien sûr le niveau3 reste donc également inactif.
Y-a t-il une méthode pour récupérer dans le résultat du formulaire, les résultats des 3 niveaux de menu ?
Je ne suis pas sûr d'être très clair...