Bottons de ' submit '

lifeandrain -  
arthezius Messages postés 3538 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
je veux mettre un bottons de ' submit ' pour ce formulaire, et quand tu clic .. Vous montrer la page que vous demandez ....

//////

<html>



<head><SCRIPT language="JavaScript">
<!--
<!--
function Choix(form) {
i = form.pays.selectedIndex;
form.dep.options.length=0;
Item = new Option("Choose your region", "", false, false);
form.dep.options[0]=Item;
form.dep.selectedIndex = 0;
switch (i) {
case 1 :
var txt = new Array ('04 - Alpes de Haute Provence ','05 - Hautes Alpes','06 - Alpes Maritimes','09 – Ariège','13 - Bouches du Rhône','17 - Charente Maritime','29 - Finistère','30 – Gard','31 - Haute Garonne','33 - Gironde','34 - Hérault','38 – Isère','40 - Landes','44 - Loire Atlantique','56 - Morbihan','64 - Pyrénées Atlantiques','65 - Hautes Pyrénées','66 - Pyrénées Orientales','69 – Rhône','73 - Savoie','74 - Haute Savoie','83 - Var','85 - Vendée');
var url = new Array ('1.html','2.html','3.html','4.html','5.html','6.html','7.html','8.html','9.html','10.html','11.html','12.html','13.html','14.html','15.html','16.html','17.html','18.html','19.html','20.html','21.html','22.html','23.html');
break;
case 2 :
var txt = new Array ('Champery','Château d’Oex','Crans Montana','Haute Nendaz','Les Crozets','Les Diablerets','Leysin','Morgins','Verbier','Rougemont','Torgon','Villars sur Ollon ','Zermatt');
var url = new Array ('24.html','25.html','26.html','27.html','28.html','29.html','30.html','31.html','32.html','33.html','34.html','35.html','36.html');
break;
}

for (i=0;i<txt.length;i++) {
Item = new Option(txt[i], url[i], false, false);
form.dep.options[i+1]=Item;
}
}
// -->

function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</SCRIPT>
</head>
<body>
<FORM>
<p>
<SELECT NAME="pays" onChange='Choix(this.form)'>
<OPTION>--- Choose your country ---</OPTION>
<OPTION>France</OPTION>
<OPTION>Switzerland</OPTION>
</SELECT>

<SELECT NAME="dep" onChange="MM_jumpMenu('parent',this,0)">
<OPTION>--- Choose your region ---</OPTION>
</SELECT>
</p>
</FORM>


</body>
</html>


Merci beaucoup !

3 réponses

fredoubiz Messages postés 10 Date d'inscription   Statut Membre Dernière intervention  
 
Ca se passe à ce niveau là ton probléme mais je suis pas un as en javascript pourr te corriger : <SELECT NAME="dep" onChange="MM_jumpMenu('parent',this,0)">
0
lifeandrain
 
merci .. ça marche pas !
0
arthezius Messages postés 3538 Date d'inscription   Statut Membre Dernière intervention   475
 
La manière dont s'envoi un formulaire est défini dans la balise <form>
Exemple:
<form methode="post" action="traitement.php">


Faut revoir les bases du html.
https://openclassrooms.com/fr/courses/1603881-apprenez-a-creer-votre-site-web-avec-html5-et-css3
0