Bonjour,
J'ai trois menu deroulant lie entre eux. Je cherche comment faire pour reinitialier mettre les variable des deux derniers menus lorsque je fais une selection dans le premier. Actuellement elle reste en memoire.
j'ai sessayer en creant 2 function reload function reload(form) et function reload2(form) et en changeant le self.location mais ca ne fonctionne pas
voici mon code
Merci de votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <script type="text/javascript"> function reload(form) { var val=form.catpays.options[form.catpays.options.selectedIndex].value; var val2=form.catprovince.options[form.catprovince.options.selectedIndex].value; var cab=form.catville.options[form.catville.options.selectedIndex].value; self.location='indexprout.php?catpays=' + val +'&catprovince=' + val2 +'&catville='+ cab; } </script> <select name='catpays' onchange=\"reload(this.form)\"><option value=''>choisissez pays</option>"; while($noticia2 = mysql_fetch_array($quer2)) { if($noticia2['pays']==@$catpays){echo "<option selected value='$noticia2[pays]'>$noticia2[pays]</option>"."<BR>";} else{echo "<option value='$noticia2[pays]'>$noticia2[pays]</option> </select> <select name='catprovince' onchange=\"reload(this.form)\"><option value=''>choisissez Province</option>"; while($noticia1 = mysql_fetch_array($quer1)) { if($noticia1['province']==@$catprovince){echo "<option selected value='$noticia1[province]'>$noticia1[province]</option>"."<BR>";} else{echo "<option value='$noticia1[province]'>$noticia1[province]</option> </select> <select name='catprovince' onchange=\"reload(this.form)\"><option value=''>choisissez Province</option>"; while($noticia1 = mysql_fetch_array($quer1)) { if($noticia1['province']==@$catprovince){echo "<option selected value='$noticia1[province]'>$noticia1[province]</option>"."<BR>";} else{echo "<option value='$noticia1[province]'>$noticia1[province]</option></select>
Partager