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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
| <html>
<head>
<script language="javascript">
var pays = new Array; //nouveau tableau
pays[0] = new Array("p0", "Veuillez sélectionner"); //nouveau tableau, on va donc avoir pays[0][0]="p0"
pays[1] = new Array("p1", "Pays détaillé :");
pays[2] = new Array("p2", "Belgique");
pays[3] = new Array("p3", "Canada");
pays[4] = new Array("p4", "Italie");
pays[5] = new Array("p5", "France");
pays[6] = new Array("p6", "Suisse");
pays[7] = new Array("p7", "Autre pays :");
pays[8] = new Array("p6", "Afrique");
pays[9] = new Array("p9", "Etats Unis");
pays[10] = new Array("p10", "Luxembourg");
pays[11] = new Array("p11", "Monaco");
pays[12] = new Array("p12", "Allemagne");
pays[13] = new Array("p13", "Danemark");
pays[14] = new Array("p14", "Espagne");
pays[15] = new Array("p15", "Finlande");
pays[16] = new Array("p16", "Norvege");
pays[17] = new Array("p17", "Royaume-Uni");
pays[18] = new Array("p18", "Russie");
pays[19] = new Array("p19", "Asie");
pays[20] = new Array("p20", "Antilles");
pays[21] = new Array("p21", "Australie");
pays[22] = new Array("p22", "Autriche");
pays[23] = new Array("p23", "Brésil");
pays[24] = new Array("p24", "Balkans");
pays[25] = new Array("p25", "Guyane");
pays[26] = new Array("p26", "Guinée");
pays[27] = new Array("p27", "Guadeloupe");
pays[28] = new Array("p28", "Grèce");
pays[29] = new Array("p29", "Hongrie");
pays[30] = new Array("p30", "Irlande");
pays[31] = new Array("p31", "Pays Bas");
pays[32] = new Array("p32", "Portugal");
pays[33] = new Array("p33", "Suède");
pays[34] = new Array("p34", "Tunisie");
pays[35] = new Array("p35", "Turquie");
pays[36] = new Array("p36", "Mexique");
pays[37] = new Array("p37", "Nouvelle-Calédonie");
var ville=new Array;
// pays0
ville["p0"] = new Array;
ville["p0"][0] = new Array("p0v0", "pays0-ville0");
ville["p0"][1] = new Array("p0v1", "pays0-ville1");
//pays1
ville["p1"]=new Array;
ville["p1"][0] = new Array("p1v0", "pays1-ville0");
ville["p1"][1] = new Array("p1v1", "pays1-ville1");
// Belgique
ville["p2"] = new Array;
ville["p2"] = new Array;
ville["p2"][0] = new Array("p2v0", "Anvers");
ville["p2"][1] = new Array("p2v1", "Brabant flamand");
ville["p2"][2] = new Array("p2v2", "Brabant wallon");
ville["p2"][3] = new Array("p2v3", "Flandre-Occidentale");
ville["p2"][4] = new Array("p2v4", "Flandre-Orientale");
ville["p2"][5] = new Array("p2v5", "Hainaut");
ville["p2"][6] = new Array("p2v6", "Liége");
ville["p2"][7] = new Array("p2v7", "Limbourg");
ville["p2"][8] = new Array("p2v8", "Luxembourg");
ville["p2"][9] = new Array("p2v9", "Namur");
ville["p2"][10] = new Array("p2v10", "Bruxelles");
ville["p2"][11] = new Array("p2v11", "Liége");
ville["p2"][12] = new Array("p2v12", "Charleroi");
ville["p2"][13] = new Array("p2v13", "Mons");
ville["p2"][14] = new Array("p2v14", "Autre");
// Canada
ville["p3"] = new Array;
ville["p3"][0] = new Array("p3v0", "Alberta");
ville["p3"][1] = new Array("p3v1", "Colombie Britannique");
ville["p3"][2] = new Array("p3v2", "Île du Prince Edouard");
ville["p3"][3] = new Array("p3v3", "Manitoba");
ville["p3"][4] = new Array("p3v4", "Nouveau-Brunswick");
ville["p3"][5] = new Array("p3v5", "Nouvelle-Ecosse");
ville["p3"][6] = new Array("p3v6", "Nunavut");
ville["p3"][7] = new Array("p3v7", "Ontario");
ville["p3"][8] = new Array("p3v8", "Québec");
ville["p3"][9] = new Array("p3v9", "Québec : Montréal");
ville["p3"][10] = new Array("p3v10", "Saskatchewan");
ville["p3"][11] = new Array("p3v11", "Terre-Neuve");
ville["p3"][12] = new Array("p3v12", "Territoires du Nord-Oues");
ville["p3"][13] = new Array("p3v13", "Yukon");
ville["p3"][14] = new Array("p3v14", "Autre");
// Italie
ville["p4"] = new Array;
ville["p4"][0] = new Array("p4v0", "Turin");
ville["p4"][1] = new Array("p4v1", "Rome");
ville["p4"][2] = new Array("p4v2", "Naples");
ville["p4"][3] = new Array("p4v3", "Milan");
ville["p4"][4] = new Array("p4v4", "Autre");
// France et ses régions
region["p5"] = new Array;
region["p5"][0] = new Array("p5r0", "Alsace");
region["p5"][1] = new Array("p5r1", "Aquitaine");
region["p5"][2] = new Array("p5r2", "Auvergne");
region["p5"][3] = new Array("p5r3", "Basse-Normandie");
region["p5"][4] = new Array("p5r4", "Bourgogne");
region["p5"][5] = new Array("p5r5", "Bretagne");
region["p5"][6] = new Array("p5r6", "Centre");
region["p5"][7] = new Array("p5r7", "Champagne-Ardenne");
region["p5"][8] = new Array("p5r8", "Corse");
region["p5"][9] = new Array("p5r9", "DOM");
region["p5"][10] = new Array("p5r10", "Franche-Comté");
region["p5"][11] = new Array("p5r11", "Haute-Normandie");
region["p5"][12] = new Array("p5r12", "Ile-de-France");
region["p5"][13] = new Array("p5r13", "Languedoc-Roussillon");
region["p5"][14] = new Array("p5r14", "Limousin");
region["p5"][15] = new Array("p5r15", "Lorraine");
region["p5"][16] = new Array("p5r16", "Midi-Pyrénées");
region["p5"][17] = new Array("p5r17", "Monaco");
region["p5"][18] = new Array("p5r18", "Nord-Pas-de-Calais");
region["p5"][19] = new Array("p5r19", "Pays-de-la-Loire");
region["p5"][20] = new Array("p5r20", "Picardie");
region["p5"][21] = new Array("p5r21", "Poitou-Charentes");
region["p5"][22] = new Array("p5r22", "Provence-Alpes-Côte-d'Azur");
region["p5"][23] = new Array("p5r23", "Rhône-Alpes");
// Suisse
ville["p6"] = new Array;
ville["p6"][0] = new Array("p6v0", "Appenzell Rhodes-Extérieures");
ville["p6"][1] = new Array("p6v1", "Appenzell Rhodes-Intérieures");
ville["p6"][2] = new Array("p6v2", "Argovie");
ville["p6"][3] = new Array("p6v3", "Bâle-Ville");
ville["p6"][4] = new Array("p6v4", "Bâle-Campagne");
ville["p6"][5] = new Array("p6v5", "Berne");
ville["p6"][6] = new Array("p6v6", "Fribourg");
ville["p6"][7] = new Array("p6v7", "Genève");
ville["p6"][8] = new Array("p6v8", "Glaris");
ville["p6"][9] = new Array("p6v9", "Grisons");
ville["p6"][10] = new Array("p6v10", "Jura");
ville["p6"][11] = new Array("p6v11", "Lucerne");
ville["p6"][12] = new Array("p6v12", "Neuchâtel");
ville["p6"][13] = new Array("p6v13", "Nidwald");
ville["p6"][14] = new Array("p6v14", "Obwald");
ville["p6"][15] = new Array("p6v15", "Saint-Gall");
ville["p6"][16] = new Array("p6v16", "Schaffhouse");
ville["p6"][17] = new Array("p6v17", "Schwytz");
ville["p6"][18] = new Array("p6v18", "Soleure");
ville["p6"][19] = new Array("p6v19", "Tessin");
ville["p6"][20] = new Array("p6v20", "Thurgovie");
ville["p6"][21] = new Array("p6v21", "Uri");
ville["p6"][22] = new Array("p6v22", "Valais");
ville["p6"][23] = new Array("p6v23", "Vaud");
ville["p6"][24] = new Array("p6v24", "Zoug");
ville["p6"][25] = new Array("p6v25", "Zurich");
function filltheselect(liste, choix)
{switch (liste)
{
case "listepays":
raz("listeville");
raz("listeregion");
for (i=0; i<ville[choix].length; i++)
{
new_option = new Option(ville[choix][i][1],ville[choix][i][0]);
document.formu.elements["listeville"].
options[document.formu.elements["listeville"].length]=new_option;
}
for (i=0; i<region[choix+"v0"].length; i++)
{
new_option = new Option(region[choix+"v0"][i][1],region[choix+"v0"][i][0]);
document.formu.elements["listeregion"].options[document.formu.
elements["listeregion"].length]=new_option;
}
break;
case "listeville":
raz("listeregion");
for (i=0; i<region[choix].length; i++)
{
new_option = new Option(region[choix][i][1],region[choix][i][0]);
document.formu.elements["listeregion"].options[document.formu.
elements["listeregion"].length]=new_option;
}
break;
}
}
function raz(liste)
{l=document.formu.elements[liste].length;
for (i=l; i>=0; i--)
document.formu.elements[liste].options[i]=null;
}
</script>
</head>
<body>
<form name="formu">
Choisir un pays
<select name="listepays" onChange='javascript:filltheselect(this.name, this.value)'>
<script language="javascript">
for (i=0; i<pays.length; i++)
document.write("<option value=\"" +pays[i][0]+ "\">" +pays[i][1]);
</script>
</select>
<br>
Choisir une ville
<select name="listeville" onChange='javascript:filltheselect(this.name, this.value)'>
<script language="javascript">
for (i=0; i<ville["p0"].length; i++)
document.write("<option value=\"" +ville["p0"][i][0]+ "\">" +ville["p0"][i][1]);
</script>
</select>
<br>
Choisir une region
<select name="listeregion">
<script language="javascript">
for (i=0; i<region["p0r0"].length; i++)
document.write("<option value=\"" +region["p0r0"][i][0]+ "\">" +region["p0r0"][i][1]);
</script>
</select>
</form>
</body>
</html> |
Partager