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
|
<script type="text/javascript">
<!--
list_choix1 = {
"Région" : ["Département"],
"Alsace" : ["(67) Bas-Rhin","(68) Haut-Rhin"],
"Aquitaine" : ["(24) Dordogne","(33) Gironde","(40) Landes","(47) Lot-et-Garonne","(64) Pyrénées-Atlantiques"],
"Auvergne" : ["(03) Allier","(15) Cantal","(43) Haute-Loire","(63) Puy-de-Dôme"],
"Basse-Normandie" : ["(14) Calvados","(50) Manche","(61) Orne"],
"Bourgogne" : ["(21) Côte-d\'Or","(58) Nièvre","(71) Saône-et-Loire","(89) Yonne"],
"Bretagne" : ["(22) Côtes-d\'Armor","(29) Finistère","(35) Ille-et-Vilaine","(56) Morbihan"],
"Centre" : ["(18) Cher","(28) Eure-et-Loire","(36) Indre","(37) Indre-et-Loire","(41) Loir-et-Cher","(45) Loiret"],
"Champagne-Ardenne" : ["(08) Ardennes","(10) Aube","(51) Marne","(52) Haute-Marne"],
"Collectivités et Territoires d'Outre-Mer" : ["(984) Terres Australes et Antarctiques","(986) Wallis et Futuna","(987) Polynésie Française","(988) Nouvelle-Calédonie"],
"Corse" : ["(2A) Corse-du-Sud","(2B) Haute-Corse"],
"Départements d'Outre-Mer" : ["(971) Guadeloupe","(972) Martinique","(973) Guyane","(974) La Réunion","(975) Saint-Pierre-et-Miquelon","(976) Mayotte"],
"Franche-Comté" : ["(25) Doubs","(39) Jura","(70) Haute-Saône","(90) Territoire de Belfort"],
"Haute Normandie" : ["(27) Eure","(76) Seine-Maritime"],
"Ile-de-France" : ["(75) Paris","(77) Seine-et-Marne","(78) Yvelines","(91) Essonne","(92) Hauts-de-Seine","(93) Seine-Saint-Denis","(94) Val-de-Marne","(95) Val-d\'Oise"],
"Languedoc-Roussillon" : ["(11) Aude" ,"(30) Gard","(34) Hérault","(48) Lozère","(66) Pyrénées-Orientales"],
"Limousin" : ["(19) Corrèze","(23) Creuse","(87) Haute-Vienne"],
"Lorraine" : ["(54) Meurthe-et-Moselle","(55) Meuse","(57) Moselle","(88) Vosges"],
"Midi-Pyrénées" : ["(09) Ariège","(12) Aveyron","(31) Haute-Garonne","(32) Gers","(46) Lot","(65) Hautes-Pyrénées","(81) Tarn","(82) Tarn-et-Garonne"],
"Nord-Pas-de-Calais" : ["(59) Nord","(62) Pas-de-Calais"],
"Pays de la Loire" : ["(44) Loire-Atlantique","(49) Maine-et-Loire","(53) Mayenne","(72) Sarthe","(85) Vendée"],
"Picardie" : ["(02) Aisne","(60) Oise","(80) Somme"],
"Poitou-Charentes" : ["(16) Charente","(17) Charente-Maritime","(79) Deux-Sèvres","(86) Vienne"],
"Provence-Alpes-Côte-d'Azur" : ["(04) Alpes-de-Haute-Provence","(05) Hautes-Alpes","(06) Alpes-Maritimes","(13) Bouches-du-Rhône","(83) Var","(84) Vaucluse"],
"Rhône-Alpes" : ["(01) Ain","(07) Ardèche","(26) Drôme","(38) Isère","(42) Loire","(69) Rhône","(73) Savoie","(74) Haute-Savoie"],
"Département" : ["Ville"]
}
list_choix2 = {
"Département" : ["Ville"],
"(68) Haut-Rhin" : ["1","2","3"],
"(67) Bas-Rhin" : ["4","5","6"]
}
function ajout(selection){
nb_select = selection.parentNode.getElementsByTagName("select").length;
if ( selection == selection.parentNode.getElementsByTagName("select")[nb_select-1] ) {
element_select = selection;
selection = selection.options[selection.selectedIndex].value;
if (list_choix1[selection] ) {
new_liste = document.createElement("select");
element_select.parentNode.appendChild(new_liste);
new_liste.setAttribute("id", "choix"+nb_select);
new_liste.setAttribute("name", "choix"+nb_select);
new_liste.onclick= function () {ajout1(this);};
for (var i=0; i<list_choix1[selection].length; i++) {
new_option = document.createElement("option");
new_liste.appendChild(new_option);
new_option.setAttribute("value",list_choix1[selection][i]);
new_option.text = list_choix1[selection][i];
}
}
}
else {
selection.parentNode.removeChild(selection.nextSibling);
ajout(selection);
}
if (list_choix1[new_liste.options[0].value]) {
ajout(new_liste);
}
}
function ajout1(selection){
nb_select = selection.parentNode.getElementsByTagName("select").length;
if ( selection == selection.parentNode.getElementsByTagName("select")[nb_select-1] ) {
element_select = selection;
selection = selection.options[selection.selectedIndex].value;
if (list_choix2[selection] ) {
new_liste = document.createElement("select");
element_select.parentNode.appendChild(new_liste);
new_liste.setAttribute("id", "choix"+nb_select);
new_liste.setAttribute("name", "choix"+nb_select);
for (var i=0; i<list_choix2[selection].length; i++) {
new_option = document.createElement("option");
new_liste.appendChild(new_option);
new_option.setAttribute("value",list_choix2[selection][i]);
new_option.text = list_choix2[selection][i];
}
}
}
else {
selection.parentNode.removeChild(selection.nextSibling);
ajout(selection);
ajout1(selection);
}
if (list_choix2[new_liste.options[0].value]) {
ajout(new_liste);
ajout1(new_liste);
}
}
//-->
</script> |
Partager