/**************************************************************/ // This function is used to instant-update the city choice // It is called first with the onload event in the body tag // and then each time the departement the user choose change. function vilIndep() { // The ONLY variable for (var i = 0; i < document.myform2.dep.options.length; i++) { if(document.myform2.dep.options[i].selected==true) { var depchosen = document.myform2.dep.options[i].value; } } // The four PC's departments conditions if(depchosen=='vienne') { // First specify the size of the select box... with (document.myform2.ville) { length=5; // ...and then just fill in ! options[0].value='toutes'; options[0].text='Toutes'; options[1].value='chatellerault'; options[1].text='Châtellerault'; options[2].value='jaunayclan'; options[2].text='Jaunay-Clan'; options[3].value='loudun'; options[3].text='Loudun'; options[4].value='poitiers'; options[4].text='Poitiers'; } } if(depchosen=='charente') { with (document.myform2.ville) { length=4; options[0].value='toutes'; options[0].text='Toutes'; options[1].value='angouleme'; options[1].text='Angoulême'; options[2].value='cognac'; options[2].text='Cognac'; options[3].value='confolens'; options[3].text='Confolens'; } } if(depchosen=='charentem') { with (document.myform2.ville) { length=5; options[0].value='toutes'; options[0].text='Toutes'; options[1].value='jonzac'; options[1].text='Jonzac'; options[2].value='larochelle'; options[2].text='La Rochelle'; options[3].value='rochefort'; options[3].text='Rochefort'; options[4].value='saintes'; options[4].text='Saintes'; } } if(depchosen=='deuxs') { with (document.myform2.ville) { length=5; options[0].value='toutes'; options[0].text='Toutes'; options[1].value='bressuire'; options[1].text='Bressuire'; options[2].value='niort'; options[2].text='Niort'; options[3].value='parthenay'; options[3].text='Parthenay'; options[4].value='thouars'; options[4].text='Thouars'; } } }