probleme sur menu déroulant double

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : probleme sur menu déroulant double

code double menu déroulant

par nicofau » 06 déc. 2005, 19:52

/* Daniel Fabien - 31/01/2003
* Double menu deroulant dynamique
*
* Pour tout renseignements :
* http://www.script-masters.com/home/forum/
* */

menu=new Array()

// Rajoutez un élément au tableau menu pour chaque categorie supplémentaire
// De la même façon, pensez à modifier le formulaire pour rajouter des categories.
menu[0]=new Array()
menu[1]=new Array()
menu[2]=new Array()
menu[3]=new Array()
menu[4]=new Array()
menu[5]=new Array()
menu[6]=new Array()
menu[7]=new Array()

// Modifiez ici les variables pour les menus deroulant
// la première valeur est le titre, la seconde l'url
// metter l'url à "null" si vous ne souhaitez pas une redirection pour ce titre

menu[0][0]=new Option("Villes et régions","null")
menu[0][1]=new Option("Adjim - Djerba","http://fauqueant2.free.fr/ajim/ajim.htm")
menu[0][2]=new Option("Aïn Draham","http://fauqueant2.free.fr/ain%20draham/ain%20draham.htm")
menu[0][3]=new Option("Bizerte","http://fauqueant2.free.fr/bizerte/bizerte.htm")
menu[0][4]=new Option("Carthage","http://fauqueant2.free.fr/Carthage/carthage.htm")
menu[0][5]=new Option("Chébika","null")
menu[0][6]=new Option("Chemtou","http://fauqueant2.free.fr/chemtou/chemtou.htm")
menu[0][7]=new Option("Chenini","http://fauqueant2.free.fr/chenini/chenini.htm")
menu[0][8]=new Option("Chott el Jerid","null")
menu[0][9]=new Option("Dahar Paysages","null")
menu[0][10]=new Option("Désert","null")
menu[0][11]=new Option("Djerba Explore village","http://fauqueant2.free.fr/djerba20explo ... xplore.htm")
menu[0][12]=new Option("Dougga","http://fauqueant2.free.fr/dougga/dougga.htm")
menu[0][13]=new Option("Douiret","http://fauqueant2.free.fr/douiret/douiret.htm")
menu[0][14]=new Option("Douz","null")
menu[0][15]=new Option("El Djem","http://fauqueant2.free.fr/eldjem/eldjem.htm")
menu[0][16]=new Option("El Haouaria","http://fauqueant2.free.fr/el%20haouaria ... ouaria.htm")
menu[0][17]=new Option("Erriadh Ghriba - Djerba","http://fauqueant2.free.fr/erriadh/erriadh.htm")
menu[0][18]=new Option("Gabès","null")
menu[0][19]=new Option("Gammarth","http://fauqueant2.free.fr/gammarth/gammarth.htm")
menu[0][20]=new Option("Ghar El Melh","http://fauqueant2.free.fr/ghar%20el%20m ... 20melh.htm")
menu[0][21]=new Option("Guellala - Djerba","http://fauqueant2.free.fr/guellala/guellala.htm")
menu[0][22]=new Option("Haidra","http://fauqueant2.free.fr/haidra/haidra.htm")
menu[0][23]=new Option("Hammamet","http://fauqueant2.free.fr/hammamet/hammamet.htm")
menu[0][24]=new Option("Hammamet Yasmine","http://fauqueant2.free.fr/yasmine%20ham ... mmamet.htm")
menu[0][25]=new Option("Hergla","http://fauqueant2.free.fr/hergla/hergla.htm")
menu[0][26]=new Option("Houmt Souk - Djerba","http://fauqueant2.free.fr/houmt%20souk/houmtsouk.htm")
menu[0][27]=new Option("Ile de Zembra","http://fauqueant2.free.fr/zembra/zembra.htm")
menu[0][28]=new Option("Jebel Ressas","http://fauqueant2.free.fr/jebel%20ressa ... ressas.htm")
menu[0][29]=new Option("Kairouan","http://fauqueant2.free.fr/kairouan/kairouan.htm")
menu[0][30]=new Option("Kelibia","http://fauqueant2.free.fr/kelibia/kelibia.htm")
menu[0][31]=new Option("Kerkennah","http://fauqueant2.free.fr/kerkennah/kerkennah.htm")
menu[0][32]=new Option("Kerkouane","http://fauqueant2.free.fr/kerkouane/kerkouane.htm")
menu[0][33]=new Option("Korbous","http://fauqueant2.free.fr/korbous/korbous.htm")
menu[0][34]=new Option("Ksar Ghilaine","null")
menu[0][35]=new Option("Ksar Ouled Soltane","http://fauqueant2.free.fr/ksarouledsolt ... oltane.htm")
menu[0][36]=new Option("Ksours","null")
menu[0][37]=new Option("la Goulette","http://fauqueant2.free.fr/la%20goulette ... ulette.htm")
menu[0][38]=new Option("la Marsa","http://fauqueant2.free.fr/La%20marsa/la%20marsa.htm")
menu[0][39]=new Option("Lac Ichkeul","http://fauqueant2.free.fr/lac%20ichkeul ... chkeul.htm")
menu[0][40]=new Option("Le Bardo","http://fauqueant2.free.fr/bardo/bardo.htm")
menu[0][41]=new Option("Le Kef","http://fauqueant2.free.fr/le%20kef/le%20kef.htm")
menu[0][42]=new Option("Mahdia","http://fauqueant2.free.fr/mahdia/mahdia.htm")
menu[0][43]=new Option("Makthar","http://fauqueant2.free.fr/makthar/makthar.htm")
menu[0][44]=new Option("Mareth","http://fauqueant2.free.fr/mareth/mareth.htm")
menu[0][45]=new Option("Matmata","http://fauqueant2.free.fr/matmata/matmata.htm")
menu[0][46]=new Option("Medenine","http://fauqueant2.free.fr/medenine/medenine.htm")
menu[0][47]=new Option("Mellita et Sidi Jemmour - Djerba","http://fauqueant2.free.fr/mellita/mellita.htm")
menu[0][48]=new Option("Midès","null")
menu[0][49]=new Option("Midoun - Djerba","http://fauqueant2.free.fr/midoun/midoun.htm")
menu[0][50]=new Option("Monastir","http://fauqueant2.free.fr/monastir/monastir.htm")
menu[0][51]=new Option("Nabeul","http://fauqueant2.free.fr/nabeul/nabeul.htm")
menu[0][52]=new Option("Nefta","null")
menu[0][53]=new Option("Oudhna","http://fauqueant2.free.fr/oudna/oudna.htm")
menu[0][54]=new Option("Paysages du Cap Bon","http://fauqueant2.free.fr/cap%20bon/cap%20bon.htm")
menu[0][55]=new Option("Port El Kantaoui","http://fauqueant2.free.fr/portelkantaou ... ntaoui.htm")
menu[0][56]=new Option("Rose des Sables","null")
menu[0][57]=new Option("Sbeitla","http://fauqueant2.free.fr/Sbeitla/Sbeitla.htm")
menu[0][58]=new Option("Sejenane","http://fauqueant2.free.fr/sejenane/sejenane.htm")
menu[0][59]=new Option("Selja - Lézard rouge","null")
menu[0][60]=new Option("Sfax","http://fauqueant2.free.fr/sfax/sfax.htm")
menu[0][61]=new Option("Sidi Bou Saïd","http://fauqueant2.free.fr/sfax/sfax.htm")
menu[0][62]=new Option("Sousse","http://fauqueant2.free.fr/sousse/Sousse.htm")
menu[0][63]=new Option("Stars War - Nefta","null")
menu[0][64]=new Option("Tabarka","http://fauqueant2.free.fr/tabarka/tabarka.htm")
menu[0][65]=new Option("Tamerza","null")
menu[0][66]=new Option("Tataouine","http://fauqueant2.free.fr/tataouine/tataouine.htm")
menu[0][67]=new Option("Thuburbo Majus","http://fauqueant2.free.fr/thuburbo%20ma ... 0majus.htm")
menu[0][68]=new Option("Toujane","http://fauqueant2.free.fr/toujane/toujane.htm")
menu[0][69]=new Option("Tozeur","null")
menu[0][70]=new Option("Tunis","null")
menu[0][71]=new Option("Utique","http://fauqueant2.free.fr/utique/utique.htm")
menu[0][72]=new Option("Village Ken","http://fauqueant2.free.fr/ken/ken.htm")
menu[0][73]=new Option("Zaghouan","http://fauqueant2.free.fr/zaghouan/zaghouan.htm")
menu[0][74]=new Option("Zarzis","http://fauqueant2.free.fr/zarzis/zarzis.htm")
menu[0][75]=new Option("Zemerten","http://fauqueant2.free.fr/zemerten/zemerten.htm")
menu[0][76]=new Option("Zriba","http://fauqueant2.free.fr/zriba/zriba.htm")

menu[1][0]=new Option("Musée du Bardo préhistoire","http://fauqueant2.free.fr/bardo/bardo%20prehistoire.htm")
menu[1][1]=new Option("Carthage punique","http://fauqueant2.free.fr/Carthage/cart ... unique.htm")
menu[1][2]=new Option("Kerkouane","http://fauqueant2.free.fr/kerkouane/kerkouane.htm")
menu[1][3]=new Option("Musée du Bardo punique","http://fauqueant2.free.fr/bardo/bardo%20punique.htm")
menu[1][4]=new Option("Musée du Bardo numide","http://fauqueant2.free.fr/bardo/bardo%20numide.htm")
menu[1][5]=new Option("Carthage","http://fauqueant2.free.fr/Carthage/cart ... romain.htm")
menu[1][6]=new Option("Dougga","http://fauqueant2.free.fr/dougga/dougga.htm")
menu[1][7]=new Option("El Djem","http://fauqueant2.free.fr/eldjem/eldjem.htm")
menu[1][8]=new Option("Bulla Regia","http://fauqueant2.free.fr/bulla%20regia ... 0regia.htm")
menu[1][9]=new Option("Sbeitla","http://fauqueant2.free.fr/Sbeitla/Sbeitla.htm")
menu[1][10]=new Option("Makthar","http://fauqueant2.free.fr/makthar/makthar.htm")
menu[1][11]=new Option("Thuburbo Majus","http://fauqueant2.free.fr/thuburbo%20ma ... 0majus.htm")
menu[1][12]=new Option("Haidra","http://fauqueant2.free.fr/haidra/haidra.htm")
menu[1][13]=new Option("Nabeul romain","http://fauqueant2.free.fr/nabeul/nabeul%20romain.htm")
menu[1][14]=new Option("Oudhna","http://fauqueant2.free.fr/oudna/oudna.htm")
menu[1][15]=new Option("Chemtou","http://fauqueant2.free.fr/chemtou/chemtou.htm")
menu[1][16]=new Option("Utique","http://fauqueant2.free.fr/utique/utique.htm")
menu[1][17]=new Option("Musée du Bardo romain","http://fauqueant2.free.fr/bardo/bardo%20romain.htm")
menu[1][18]=new Option("Musée de Sousse","http://fauqueant2.free.fr/sousse%20muse ... 0musee.htm")
menu[1][19]=new Option("Musée d'El Jem","http://fauqueant2.free.fr/eldjem/eldjem%20musee.htm")
menu[1][20]=new Option("Zaghouan et Aqueduc","http://fauqueant2.free.fr/zaghouanetaqu ... queduc.htm")
menu[1][21]=new Option("La Tunisie Antique","http://fauqueant2.free.fr/tuantique/FrameSet.htm")

menu[2][0]=new Option("Bizerte","http://fauqueant2.free.fr/bizerte/bizerte.htm")
menu[2][1]=new Option("Chébika","null")
menu[2][2]=new Option("Chenini","null")
menu[2][3]=new Option("Douiret","null")
menu[2][4]=new Option("Douz","null")
menu[2][5]=new Option("Ghar El Melh","http://fauqueant2.free.fr/ghar%20el%20m ... 20melh.htm")
menu[2][6]=new Option("Hammamet","http://fauqueant2.free.fr/hammamet/hammamet.htm")
menu[2][7]=new Option("Hergla","http://fauqueant2.free.fr/hergla/hergla.htm")
menu[2][8]=new Option("Houmt Souk - Djerba","http://fauqueant2.free.fr/houmt%20souk/houmtsouk.htm")
menu[2][9]=new Option("Kairouan","http://fauqueant2.free.fr/kairouan/kairouan.htm")
menu[2][10]=new Option("Ksar Ouled Soltane","null")
menu[2][11]=new Option("Ksours","null")
menu[2][12]=new Option("Le Kef","http://fauqueant2.free.fr/le%20kef/le%20kef.htm")
menu[2][13]=new Option("Mahdia","http://fauqueant2.free.fr/mahdia/mahdia.htm")
menu[2][14]=new Option("Matmata","null")
menu[2][15]=new Option("Midès","null")
menu[2][16]=new Option("Midoun - Djerba","http://fauqueant2.free.fr/midoun/midoun.htm")
menu[2][17]=new Option("Monastir","http://fauqueant2.free.fr/monastir/monastir.htm")
menu[2][18]=new Option("Nefta","null")
menu[2][19]=new Option("Sfax","http://fauqueant2.free.fr/sfax/sfax.htm")
menu[2][20]=new Option("Sidi Bou Saïd","http://fauqueant2.free.fr/sfax/sfax.htm")
menu[2][21]=new Option("Sousse","http://fauqueant2.free.fr/sousse/Sousse.htm")
menu[2][22]=new Option("Tamerza","null")
menu[2][23]=new Option("Toujane","null")
menu[2][24]=new Option("Tozeur","null")
menu[2][25]=new Option("Tunis","null")

menu[3][0]=new Option("Aïn Draham","http://fauqueant2.free.fr/ain%20draham/ain%20draham.htm")
menu[3][1]=new Option("Gammarth","http://fauqueant2.free.fr/gammarth/gammarth.htm")
menu[3][2]=new Option("Korbous","http://fauqueant2.free.fr/korbous/korbous.htm")
menu[3][3]=new Option("la Goulette","http://fauqueant2.free.fr/la%20goulette ... ulette.htm")
menu[3][4]=new Option("la Marsa","http://fauqueant2.free.fr/La%20marsa/la%20marsa.htm")
menu[3][5]=new Option("Mareth","http://fauqueant2.free.fr/mareth/mareth.htm")
menu[3][6]=new Option("Medenine","null")
menu[3][7]=new Option("Nabeul","http://fauqueant2.free.fr/nabeul/nabeul.htm")
menu[3][8]=new Option("Port El Kantaoui","http://fauqueant2.free.fr/portelkantaou ... ntaoui.htm")
menu[3][9]=new Option("Sfax","http://fauqueant2.free.fr/sfax/sfax.htm")
menu[3][10]=new Option("Tabarka","http://fauqueant2.free.fr/tabarka/tabarka.htm")
menu[3][11]=new Option("Tataouine","null")
menu[3][12]=new Option("Tunis","null")
menu[3][13]=new Option("Village Ken","http://fauqueant2.free.fr/ken/ken.htm")
menu[3][14]=new Option("Yasmine Hammamet","http://fauqueant2.free.fr/yasmine%20ham ... mmamet.htm")
menu[3][15]=new Option("Zarzis","http://fauqueant2.free.fr/zarzis/zarzis.htm")

menu[4][0]=new Option("La Kroumirie","null")
menu[4][1]=new Option("Le Tell","null")
menu[4][2]=new Option("Le Cap Bon","null")
menu[4][3]=new Option("Le Sahel","null")
menu[4][4]=new Option("Le Jerid","null")
menu[4][5]=new Option("Le Dahar","null")
menu[4][6]=new Option("La Nefzaoua","null")
menu[4][7]=new Option("Le Sahara","null")
menu[4][8]=new Option("Faune","null")
menu[4][9]=new Option("Flore","null")

menu[5][0]=new Option("Costumes","null")
menu[5][1]=new Option("Céramiques","null")
menu[5][2]=new Option("Bijoux","null")
menu[5][3]=new Option("Tapis et tissage","null")
menu[5][4]=new Option("Objets cuivres","null")
menu[5][5]=new Option("Objets bois","null")
menu[5][6]=new Option("Les musées d'Arts et Traditions","nul0l")
menu[5][7]=new Option("Les musées privés","null")



// Ne rien modifié sous cette ligne
function changeSousTheme(numeroMenu){
for (i=document.menuDeroulant.sousTheme.options.length-1;i>0;i--){
document.menuDeroulant.sousTheme.options=null
}

for (i=0;i<menu[numeroMenu].length;i++){
document.menuDeroulant.sousTheme.options=new Option(menu[numeroMenu].text,menu[numeroMenu].value)
}

document.menuDeroulant.sousTheme.selectedIndex=0
}

function selectmenu(theme_prin){
if (theme_prin.theme.options[theme_prin.theme.selectedIndex].value == "null"){
alert('selectionnez d\'abord un theme');
}
else{
window.top.location.href = theme_prin.theme.options[theme_prin.theme.selectedIndex].value;
}
}

function destination(){
var destination = document.menuDeroulant.sousTheme.options[document.menuDeroulant.sousTheme.selectedIndex].value;

if(destination=="null"){
alert('prochainement en ligne');
}
else{
window.top.location.href = destination;
}
}

<FORM NAME="menuDeroulant">
<div align="left">
<select name="theme" size=1 onchange="selectmenu(this.form)">
<option selected value="null">Th&eacute;me Principal</option>
<option value="Javascript:changeSousTheme(0)">Villes et R&eacute;gions</option>
<option value="Javascript:changeSousTheme(1)">Antiquit&eacute;</option>
<option value="Javascript:changeSousTheme(2)">Islam</option>
<option value="Javascript:changeSousTheme(3)">Moderne</option>
<option value="Javascript:changeSousTheme(4)">G&eacute;ographie</option>
<option value="Javascript:changeSousTheme(5)">Artisanat et artisans</option>
<option value="Javascript:changeSousTheme(6)">Arts et traditions</option>
<option value="Javascript:changeSousTheme(7)">Tourisme et loisirs</option>
</select> <select name="sousTheme" style="width:225" size="1">
<option value="null">Selectionner d'abord un th&eacute;me</option>
</select><br>
<input type=button onclick="destination()" value="Valider"></div>
</FORM>



ce double menu déroulant ne fonctionne pas on peut choisir une localité dans le premier menu mais ne déclenche pas le second

par mere-teresa » 06 déc. 2005, 15:31

J'irais pas voir ton site, alors bon...quel est ce que tu cherches à faire ? Quelle est ta question ? Et quel est le code qui pose problème ?

aide plus précise

par nicofau » 06 déc. 2005, 14:38

merci pour vos réponses mais je ne comprends toujours pas

mere-teresa de quel code il s'agit ?

a+

par mere-teresa » 06 déc. 2005, 13:55

Met ton code

par Cyrano » 05 déc. 2005, 23:10

Jette donc un coup d'oeil ICI, la réponse à ta question s'y trouve peut-être bien.

probleme sur menu déroulant double

par nicofau » 05 déc. 2005, 23:01

Débutant, j'en appelle à votre aide, j'ai mis sur ma page d'accueil de ma photothèque un double menu déroulant qui fonctionne sur mon ordinateur en hors ligne mais qui se refuse de fonctionner dès qu'il est en ligne.

Ci joint l'adresse :
www.imagesdetunisie.com

quelqu'un peut prendre quelques minutes pour étudier mon script et me renseigner

merci

:( :(