begin process at 2012 05 29 09:03:04
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Javascript / DHTML / Ajax

 > 

JavaScript Orienté objet (POO)

 > 

Function & Méthodes

 > 

getElementById


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

getElementById

lundi 14 janvier 2008 à 09:02:11 | getElementById

isu_san

Bonjour à tous et toutes et meilleurs voeux.

J'ai un soucis avec le getElementById. Voici mon besoin :  dans une page avec différent calques 'hidden' (des infos sur chaque departement), j'ai besoin d'afficher le calque correspondant au département retourné par un formulaire.

je ne sais tout simplement pas comment faire.
 
Voici un des calques :
<div id="martinique" style="position:absolute; left:195px; top:126px; width:410px; height:133px; z-index:2; background-color: #DEF5F4; layer-background-color: #DEF5F4; border: 1px none #000000; visibility: hidden;">
  <p align="center"><span class="Style3">MARTINIQUE</span></p>
  <p align="center"><span class="Style1">M. le Directeur du service d&eacute;partemental de l'O.N.A.C.V.G.</span></p>
  <p align="center" class="Style1">9, rue Louis-Blanc<br>
  97200 FORT DE FRANCE (Martinique)  </p>
</div>

Il devra être affiché lorsqu'on saisira 97 dans le champ département.
Merci d'avance
lundi 14 janvier 2008 à 12:04:23 | Re : getElementById

XtremDuke

Salut,

Utilise un tableau associatif en JS.

Exemple :

var myTable = [];
myTable[97] = "martinique";

Ensuite il ne te reste plus qu'à afficher ton calque en fonction de la valeur
champ département<->tableau associatif.

Exemple :

function showDiv(departement){
    document.getElementById(myTable[departement]).style.display = "block";
}

lundi 14 janvier 2008 à 14:29:34 | Re : getElementById

isu_san

j'ai du mal a comprendre comment faire correspondre le champ departement avec le tableau
il faut que je fasse un if pour chaque departement ?
lundi 14 janvier 2008 à 15:06:26 | Re : getElementById

XtremDuke

Non justement.

Je vai essayer de te montrer une solution à travers un exemple basic:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
<script language="JavaScript" type="text/javascript">
    var lstDpts = [];
    lstDpts[33] = "gironde";
    lstDpts[60] = "oise";
    lstDpts[97] = "martinique";
   
    function showDpt(){
        var dpt = document.getElementById("departement").value;
        document.getElementById(lstDpts[dpt]).style.display = "block";
    }
</script>
</head>
<body>
    <input type="text" id="departement"/> <input type="button" value="Voir" onclick="showDpt()"/>
    <div id="oise" style="display:none;"><h2>Oise</h2>blablabla blablabla blablabla</div>
    <div id="martinique" style="display:none;"><h2>Martinique</h2>blablabla blablabla blablabla</div>
    <div id="gironde" style="display:none;"><h2>Gironde</h2>blablabla blablabla blablabla</div>
</body>
</html>

lundi 14 janvier 2008 à 15:37:17 | Re : getElementById

isu_san

Merci beaucoup

mercredi 16 janvier 2008 à 10:52:17 | Re : getElementById

isu_san

Petite correction, ca fonctionne............ presque

la fonction marche nickel, mais pour une raison que j'ignore, lorsque je l'insere dans ma page, le calque s'affiche lorsqu'on valide le form, mais disparait aussitot...
(je me suis d'ailleurs rendu compte que dans le formulaire je pouvais utiliser la fonction générée par dreamweaver pour les departements cliqués sur la carte....)
je mets l'integralité du scipt si qqun a le courage :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<TITLE>carte ACVG</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="Microsoft FrontPage 4.0" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId>
<STYLE type=text/css>
BODY {
 SCROLLBAR-FACE-COLOR: #7094d8; SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; SCROLLBAR-SHADOW-COLOR: #053eaa; SCROLLBAR-3DLIGHT-COLOR: #053eaa; SCROLLBAR-ARROW-COLOR: #053eaa; SCROLLBAR-TRACK-COLOR: #99afd7; SCROLLBAR-DARKSHADOW-COLOR: #053eaa
}
.Style1 {color: #0000FF}
.Style3 {color: #0000FF; font-weight: bold; }
.Style4 {color: #ECE9D8}
</STYLE>
<script language="javascript">
function sf() {
document.formulaire.departement.focus()
}
</script>

<script Language="JavaScript"><!--
function valid_formulaire(theForm)
{


  if ((theForm.dpt.value =="")||(theForm.dpt.value =="00"))
  {
    alert("Veuillez indiquer le département.");
    theForm.dpt.focus();
    return (false);
  }
  if (theForm.dpt.value.length != 2)
  {
    alert("Le département doit comporter 2caractères.");
    theForm.dpt.focus();
    return (false);
  }
  if (theForm.dpt.value == "20")
  {
    alert("Pour la Corse veuillez saisir 2A ou 2B.");
    theForm.dpt.focus();
    return (false);
  }
    var d=theForm.dpt.value
      if ((isNaN(d)==true)&&(d!="2a")&&(d!="2b")&&(d!="2A")&&(d!="2B"))
  {
    alert("Le département doit être numérique");
    theForm.dpt.focus();
    return (false);
  }
var num_dep=theForm.dpt.value
  if ((num_dep == "96")||(num_dep == "99")||(num_dep == "98"))
  {
    alert("Le département "+num_dep+" n'est pas valide.");
    theForm.dpt.focus();
    return (false);
  }
  if (theForm.dpt.value == "97")
  {
    alert("Pas de direction anciens combattants pour le département 97.");
    theForm.dpt.focus();
    return (false);
  }
  return (gotolink(this.form));
}
//--></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</script>
</HEAD>
<BODY bgColor=#7094d8 leftMargin=30 topMargin=0 onLoad="sf()">

 

<div id="guadeloupe" style="position:absolute; left:196px; top:126px; width:409px; height:126px; z-index:14; background-color: #DEF5F4; layer-background-color: #DEF5F4; border: 1px none #000000; visibility: hidden;">
  <p align="center" class="Style1"><strong>GUADELOUPE</strong></p>
  <p align="center" class="Style1">  M. le Directeur du service d&eacute;partemental de l'O.N.A.C.V.G.</p>
  <p align="center" class="Style1">Cit&eacute; Guillard<br>
  97109 BASSE TERRE CEDEX (Guadeloupe)</p>
</div>
<div id="martinique" style="position:absolute; left:195px; top:126px; width:410px; height:133px; z-index:12; background-color: #DEF5F4; layer-background-color: #DEF5F4; border: 1px none #000000; visibility: hidden;">
  <p align="center"><span class="Style3">MARTINIQUE</span></p>
  <p align="center"><span class="Style1">M. le Directeur du service d&eacute;partemental de l'O.N.A.C.V.G.</span></p>
  <p align="center" class="Style1">9, rue Louis-Blanc<br>
  97200 FORT DE FRANCE (Martinique)  </p>
</div>
<div id="guyane" style="position:absolute; left:195px; top:125px; width:411px; height:128px; z-index:13; background-color: #DEF5F4; layer-background-color: #DEF5F4; border: 1px none #000000; visibility: hidden;">
  <p align="center" class="Style3 Style1">GUYANE</p>
  <p align="center" class="Style1">M. le Directeur du service d&eacute;partemental de l'O.N.A.C.V.G.</p>
  <p align="center" class="Style1">40, rue des 14 et 22 juin 1962 - B.P. 5004<br>
    97305 CAYENNE CEDEX (Guyane Fran&ccedil;aise) </p>
</div>
<div id="reunion" style="position:absolute; left:194px; top:124px; width:413px; height:129px; z-index:4; background-color: #DEF5F4; layer-background-color: #DEF5F4; border: 1px none #000000; visibility: hidden;">
  <div align="center" class="Style3">REUNION
  </div>
  <p align="center" class="Style1">M. le Directeur du service d&eacute;partemental de l'O.N.A.C.V.G.</p>
  <p align="center" class="Style1">11, rue de Nice - Immeuble des Haras<br>
    97405 SAINT DENIS (R&eacute;union)
  </p>
</div>
<div id="mayotte" style="position:absolute; left:193px; top:123px; width:413px; height:130px; z-index:11; background-color: #DEF5F4; layer-background-color: #DEF5F4; border: 1px none #000000; visibility: hidden;">
  <p align="center" class="Style3">MAYOTTE</p>
  <p align="center" class="Style1">M. le Pr&eacute;fet de Mayotte</p>
  <p align="center" class="Style1">B.P. 20 <br>
    97610 DZAOUDZI
  </p>
</div>
<div id="miquelon" style="position:absolute; left:192px; top:122px; width:413px; height:130px; z-index:10; background-color: #DEF5F4; layer-background-color: #DEF5F4; border: 1px none #000000; visibility: hidden;">
  <p align="center" class="Style3">SAINT PIERRE ET MIQUELON </p>
  <p align="center" class="Style1">M. le Pr&eacute;fet<br>
    Service de l'O.N.A.C.V.G.<br>
    Place du Lieutenant Colonel Pigeaud<br>
    B.P. 4211<br>
    97500 SAINT PIERRE ET MIQUELON</p>
</div>
<div id="caledonie" style="position:absolute; left:190px; top:121px; width:414px; height:133px; z-index:15; background-color: #DEF5F4; layer-background-color: #DEF5F4; border: 1px none #000000; visibility: hidden;">
  <p align="center" class="Style3">NOUVELLE CALEDONIE</p>
  <p align="center" class="Style1">M. le Haut Commissaire de la R&eacute;publique<br>
    Service administratif de l'O.N.A.C.V.G.<br>
    Maison du Combattant<br>
    52 bis, Avenue du Mar&eacute;chal Foch<br>
    NOUMEA (Nouvelle Cal&eacute;donie)
  </p>
</div>
<div id="dep14" style="position:absolute; left:189px; top:120px; width:419px; height:134px; z-index:32; background-color: #DEF5F4; layer-background-color: #DEF5F4; border: 1px none #000000; visibility: hidden;" onClick="MM_showHideLayers('dep14','','hide')">
  <p align="center" class="Style3"> CAEN </p>
  <p align="center" class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
  Rue Neuve Bourg l'Abb&eacute;, BP 10527<br>
  14 036 CAEN cedex 1  </p>
  <p align="center" class="Style1">T&eacute;l : 02 31 38 47 00 Fax : 02 31 38 47 03 </p>
</div>
<div id="dep13" style="position:absolute; left:189px; top:118px; width:418px; height:172px; z-index:33; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000; visibility: hidden;" onClick="MM_showHideLayers('dep13','','hide')">
  <div align="center">
    <p class="Style1">MARSEILLE</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    11 rue Lafon, BP 6<br>
    13 251 MARSEILLE cedex 20</p>
    <p class="Style1">T&eacute;l : 04 91 04 75 00 Fax : 04 91 04 75 44 <br>
    </p>
  </div>
</div>
<div id="dep21" style="position:absolute; left:188px; top:117px; width:418px; height:173px; z-index:31; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000; visibility: hidden;" onClick="MM_showHideLayers('dep21','','hide')">
  <div align="center">
    <p class="Style1">DIJON</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
      anciens combatants<br>
      4 bis rue Hoche, BP 1584<br>
    21 032 DIJON cedex</p>
    <p class="Style1">T&eacute;l : 03 80 40 29 00 Fax : 03 80 43 81 79       <br>
    </p>
  </div>
</div>
<div id="dep2a" style="position:absolute; left:189px; top:117px; width:417px; height:172px; z-index:34; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000; visibility: hidden;" onClick="MM_showHideLayers('dep2a','','hide')">
  <div align="center">
    <p class="Style1">AJACCIO</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    18 avenue Colonna d'Ornano, BP 32<br>
    20 181 AJACCIO cedex 1</p>
    <p class="Style1">T&eacute;l : 04 95 23 75 00 Fax : 04 95 23 75 49     </p>
  </div>
</div>
<div id="dep31" style="position:absolute; left:189px; top:116px; width:417px; height:173px; z-index:30; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep31','','hide')">
  <div align="center">
    <p class="Style1">TOULOUSE</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants de Midi-Pyr&eacute;n&eacute;es<br>
    Rue de la cit&eacute; administrative<br>
    31 074 TOULOUSE cedex</p>
    <p class="Style1">T&eacute;l : 05 67 69 38 00 Fax : 05 67 69 38 48     </p>
  </div>
</div>
<div id="dep33" style="position:absolute; left:189px; top:117px; width:418px; height:172px; z-index:29; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep33','','hide')">
  <div align="center">
    <p class="Style1">BORDEAUX</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    Cit&eacute; administrative, rue Jules Ferry, BP 80<br>
    33 090 BORDEAUX cedex </p>
    <p class="Style1">T&eacute;l : 05 56 24 85 77 Fax 05 56 24 85 73 </p>
  </div>
</div>
<div id="polynesie" style="position:absolute; left:193px; top:122px; width:411px; height:151px; z-index:8; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('polynesie','','hide');MM_showHideLayers('polynesie','','hide')">
  <div align="center" class="Style4">
    <p class="Style3">POLYNESIE</p>
    <p class="Style1">M. le Haut Commissaire de la R&eacute;publique</p>
    <p class="Style1">O.N.A.C.V.G. BP 15</p>
    <p class="Style1">PAPEETE (Polyn&eacute;sie Fran&ccedil;aise)   </p>
  </div>
</div>
<div id="dep34" style="position:absolute; left:189px; top:117px; width:418px; height:171px; z-index:28; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000; visibility: hidden;" onClick="MM_showHideLayers('dep34','','hide')">
  <div align="center">
    <p class="Style1">MONTPELLIER</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    2 place Paul Bec, CS 99509<br>
    34 960 MONTPELLIER cedex 2 </p>
    <p class="Style1">T&eacute;l : 04 67 99 75 75 Fax : 04 67 99 75 76 </p>
  </div>
</div>
<div id="dep35" style="position:absolute; left:189px; top:118px; width:417px; height:172px; z-index:27; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep35','','hide')">
  <div align="center">
    <p class="Style1">RENNES</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    Cit&eacute; administrative, BP 60702<br>
    boulevard de la Libert&eacute;<br>
    35 007 RENNES cedex</p>
    <p class="Style1">T&eacute;l : 02 99 78 15 15 Fax : 02 99 78 20 76     </p>
  </div>
</div>
<div id="dep37" style="position:absolute; left:188px; top:119px; width:416px; height:173px; z-index:26; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep37','','hide')">
  <div align="center">
    <p class="Style1">TOURS</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    Quartier Baraguey d'Hilliers<br>
    60 bld Thiers, BP 3205<br>
    37032 TOURS cedex</p>
    <p class="Style1">T&eacute;l : 02 47 77 27 44 Fax : 02 47 77 27 34     </p>
  </div>
</div>
<div id="dep44" style="position:absolute; left:189px; top:119px; width:417px; height:170px; z-index:25; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep44','','hide')">
  <div align="center">
    <p class="Style1">NANTES</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    104 rue Gambetta, BP 63607<br>
    44 036 NANTES cedex</p>
    <p class="Style1">T&eacute;l : 02 40 14 57 30 Fax : 02 40 93 30 98     </p>
  </div>
</div>
<div id="dep57" style="position:absolute; left:187px; top:116px; width:419px; height:174px; z-index:24; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep57','','hide')">
  <div align="center">
    <p class="Style1">METZ</p>
    <p class="Style1">Direction interr&eacute;gionale charg&eacute;e des<br>
    anciens combatants<br>
    Cit&eacute; administrative, rue du Chanoine Collin<br>
    BP 51055<br>
    57 036 METZ cedex 1</p>
    <p class="Style1">T&eacute;l : 03 87 34 77 67 Fax : 03 87 36 95 99     </p>
  </div>
</div>
<div id="dep58" style="position:absolute; left:189px; top:117px; width:419px; height:173px; z-index:23; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;">
  <div align="center">
    <p class="Style1">CHATEAU CHINON </p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    1 place Fran&ccedil;ois Mitterand, BP 17<br>
    58 120 CHATEAU CHINON</p>
    <p class="Style1">T&eacute;l : 03 86 85 19 55 Fax : 03 86 85 29 99     </p>
  </div>
</div>
<div id="dep59" style="position:absolute; left:189px; top:119px; width:420px; height:173px; z-index:22; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep59','','hide')">
  <div align="center">
    <p class="Style1">LILLE</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    Cit&eacute; administrative, rue de Tournai<br>
    59 045 LILLE cedex</p>
    <p class="Style1">T&eacute;l : 03 20 62 12 34 Fax : 03 20 62 12 30  </p>
  </div>
</div>
<div id="dep63" style="position:absolute; left:188px; top:117px; width:420px; height:173px; z-index:21; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep63','','hide')">
  <div align="center">
    <p class="Style1">CLERMONT FERRAND </p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    Cit&eacute; administrative, rue Pellissier, BP 152<br>
    63 034 CLERMONT FERRAND cedex 1</p>
    <p class="Style1">T&eacute;l : 04 73 42 40 40 Fax : 04 73 90 06 99 </p>
  </div>
</div>
<div id="dep67" style="position:absolute; left:189px; top:117px; width:418px; height:172px; z-index:20; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep67','','hide')">
  <div align="center">
    <p class="Style1">STRASBOURG</p>
    <p class="Style1">Direction interd&eacute;partementale des<br>
    anciens combatants<br>
    Cit&eacute; administrative Gaujot, 14 rue du Mar&eacute;chal Juin<br>
    67 084 STRASBOURG cedex</p>
    <p class="Style1">T&eacute;l : 03 88 76 78 84 Fax : 03 88 76 78 89     </p>
  </div>
</div>
<div id="dep69" style="position:absolute; left:188px; top:117px; width:418px; height:172px; z-index:19; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep69','','hide')">
  <div align="center">
    <p class="Style1">LYON</p>
    <p class="Style1">Direction interr&eacute;gionale charg&eacute;e des<br>
anciens combatants<br>
    53 rue de Cr&eacute;pi, BP 6057<br>
    69 412 LYON cedex 06</p>
    <p class="Style1">T&eacute;l : 04 78 93 92 96 Fax : 04 78 89 32 48     </p>
  </div>
</div>
<div id="dep76" style="position:absolute; left:189px; top:118px; width:416px; height:172px; z-index:18; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep76','','hide')">
  <div align="center">
    <p class="Style1">ROUEN</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    Cit&eacute; administrative, 2 rue Saint Sever<br>
    76 032 TOUEN cedex</p>
    <p class="Style1">T&eacute;l : 02 35 58 59 34 Fax : 02 35 58 59 35 </p>
  </div>
</div>
<div id="dep87" style="position:absolute; left:189px; top:118px; width:419px; height:173px; z-index:17; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep87','','hide')">
  <div align="center">
    <p class="Style1">LIMOGES</p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
    anciens combatants<br>
    22 rue Mirabeau<br>
    87 060 LIMOGES cedex</p>
    <p class="Style1">T&eacute;l : 05 55 34 45 45 Fax : 05 55 34 34 80     </p>
  </div>
</div>
<div id="dep94" style="position:absolute; left:188px; top:118px; width:418px; height:173px; z-index:16; visibility: hidden; background-color: #def5f4; layer-background-color: #def5f4; border: 1px none #000000;" onClick="MM_showHideLayers('dep94','','hide')">
  <div align="center">
    <p class="Style1">FONTENAY SOUS BOIS </p>
    <p class="Style1">Direction interd&eacute;partementale charg&eacute;e des<br>
      anciens combatants<br>
      10 avenue du Val de Fontenay<br>
      94 135 FONTENAY SOUS BOIS cedex</p>
    <p class="Style1">T&eacute;l : 01 49 74 34 00 Fax : 01 49 74 35 71 </p>
  </div>
</div>
<div align="center"></div>
  <TABLE cellSpacing=0 cellPadding=0 border=0 width="653" style="font-family: Verdana; font-size: 8 pt">
   <TR>
    <TD width="120" valign="top" align="left" rowspan="2">
    <!--webbot bot="HitCounter" u-custom="/images/Compteur_acvg.gif" i-digits="0" i-image="5"
    PREVIEW="&lt;strong&gt;[Compteur d'accès]&lt;/strong&gt;" i-resetvalue="0" startspan
    --><img src="../_vti_bin/fpcount.exe///Zi51/zi51/atprod/?Page=ac_hia/carte_acvg.asp|Custom=/images/Compteur_acvg.gif" alt="Pages trouvées"><!--webbot bot="HitCounter" endspan i-checksum="8472"
    -->
    </TD>
 <TD width="200" valign="top" align="left" rowspan="2">
    </TD>
 <TD width="520" rowspan="4"><MAP name=FPMap0>
 <!-- etranger -->
 <AREA shape=CIRCLE coords=35,261,21 href="#" onMouseOver="MM_showHideLayers('dep58','','show')" onMouseOut="MM_showHideLayers('dep58','','hide')">
 <!-- 971 --><AREA shape=CIRCLE coords=47,412,10>
 <!-- 972 --><AREA shape=CIRCLE coords=126,390,10>
 <!-- 973 --><AREA shape=CIRCLE coords=216,393,10>
 <!-- 974 --><AREA shape=CIRCLE coords=295,404,10>
 <!-- 01 --><AREA shape=CIRCLE coords=259,194,7 href="#" alt=Ain onclick="MM_showHideLayers('dep69','','show')">
 <!-- 02 --><AREA shape=CIRCLE coords=214,62,7 href="#" alt=Aisne onclick="MM_showHideLayers('dep76','','show')">
 <!-- 03 --><AREA shape=CIRCLE coords=203,181,7 href="#" alt=Allier onclick="MM_showHideLayers('dep63','','show')">
 <!-- 04 --><AREA shape=CIRCLE coords=284,269,7 href="#" alt="Alpes de haute provence" onclick="MM_showHideLayers('dep13','','show')">
 <!-- 05 --><AREA shape=CIRCLE coords=291,247,7 href="#" alt="Hautes alpes" onclick="MM_showHideLayers('dep13','','show')">
 <!-- 06 --><AREA shape=CIRCLE coords=312,272,7 href="#" alt="Alpes maritimes" onclick="MM_showHideLayers('dep13','','show')">
 <!-- 07 --><AREA shape=CIRCLE coords=238,247,7 href="#" alt=Ardèche onclick="MM_showHideLayers('dep69','','show')">
 <!-- 08 --><AREA shape=CIRCLE coords=242,62,7 href="#" alt=Ardennes onclick="MM_showHideLayers('dep57','','show')">
 <!-- 09 --><AREA shape=CIRCLE coords=158,310,7 href="#" alt=Ariège onclick="MM_showHideLayers('dep31','','show')">
 <!-- 10 --><AREA shape=CIRCLE coords=228,111,7 href="#" alt=Aube onclick="MM_showHideLayers('dep57','','show')">
 <!-- 11 --><AREA shape=CIRCLE coords=184,304,7 href="#" alt=Aude onclick="MM_showHideLayers('dep34','','show')">
 <!-- 12 --><AREA shape=CIRCLE coords=192,262,7 href="#" alt=Aveyron onclick="MM_showHideLayers('dep31','','show')">
 <!-- 13 --><AREA shape=CIRCLE coords=259,289,7 href="#" alt="Bouches du rhône" onclick="MM_showHideLayers('dep13','','show')">
 <!-- 14 --><AREA shape=CIRCLE coords=116,84,7 href="#" alt=Calvados onclick="MM_showHideLayers('dep14','','show')">
 <!-- 15 --><AREA shape=CIRCLE coords=192,233,7 href="#" alt=Cantal onclick="MM_showHideLayers('dep63','','show')">
 <!-- 16 --><AREA shape=CIRCLE coords=127,205,7 href="#" alt=Charente onclick="MM_showHideLayers('dep87','','show')">
 <!-- 17 --><AREA shape=CIRCLE coords=102,202,7 href="#" alt="Charente maritime" onclick="MM_showHideLayers('dep87','','show')">
 <!-- 18 --><AREA shape=CIRCLE coords=189,156,7 href="#" alt=Cher onclick="MM_showHideLayers('dep37','','show')">
 <!-- 19 --><AREA shape=CIRCLE coords=171,223,7 href="#" alt=Correze onclick="MM_showHideLayers('dep87','','show')">
 <!-- 2a --><AREA shape=CIRCLE coords=362,314,7 href="#" alt="Corse du sud" onclick="MM_showHideLayers('dep2a','','show')">
 <!-- 2b --><AREA shape=CIRCLE coords=363,286,7 href="#" alt="Haute corse" onclick="MM_showHideLayers('dep2a','','show')">
 <!-- 21 --><AREA shape=CIRCLE coords=245,146,7 href="#" alt="Côte d'or" onclick="MM_showHideLayers('dep21','','show')">
 <!-- 22 --><AREA shape=CIRCLE coords=47,100,7 href="#" alt="Côtes d'armor" onclick="MM_showHideLayers('dep35','','show')">
 <!-- 23 --><AREA shape=CIRCLE coords=176,195,7 href="#" alt=Creuse onclick="MM_showHideLayers('dep87','','show')">
 <!-- 24 --><AREA shape=CIRCLE coords=140,233,7 href="#" alt=Dordogne onclick="MM_showHideLayers('dep33','','show')">
 <!-- 25 --><AREA shape=CIRCLE coords=284,153,7 href="#" alt=Doubs onclick="MM_showHideLayers('dep21','','show')">
 <!-- 26 --><AREA shape=CIRCLE coords=260,246,7 href="#" alt=Drôme onclick="MM_showHideLayers('dep69','','show')">
 <!-- 27 --><AREA shape=CIRCLE coords=151,85,7 href="#" alt=Eure onclick="MM_showHideLayers('dep76','','show')">
 <!-- 28 --><AREA shape=CIRCLE coords=158,110,7 href="#" alt="Eure et loir" onclick="MM_showHideLayers('dep37','','show')">
 <!-- 29 --><AREA shape=CIRCLE coords=25,103,7 href="#" alt=Finistère onclick="MM_showHideLayers('dep35','','show')">
 <!-- 30 --><AREA shape=CIRCLE coords=235,272,7 href="#" alt=Gard onclick="MM_showHideLayers('dep34','','show')">
 <!-- 31 --><AREA shape=CIRCLE coords=158,289,7 href="#" alt="Haute garonne" onclick="MM_showHideLayers('dep31','','show')">
 <!-- 32 --><AREA shape=CIRCLE coords=130,282,7 href="#" alt=Gers onclick="MM_showHideLayers('dep31','','show')">
 <!-- 33 --><AREA shape=CIRCLE coords=106,243,7 href="#" alt=Gironde onclick="MM_showHideLayers('dep33','','show')">
 <!-- 34 --><AREA shape=CIRCLE coords=211,289,7 href="#" alt=Hérault onclick="MM_showHideLayers('dep34','','show')">
 <!-- 35 --><AREA shape=CIRCLE coords=85,114,7 href="#" alt="Ille et vilaine" onclick="MM_showHideLayers('dep35','','show')">
 <!-- 36 --><AREA shape=CIRCLE coords=165,170,7 href="#" alt=Indre onclick="MM_showHideLayers('dep37','','show')">
 <!-- 37 --><AREA shape=CIRCLE coords=141,152,7 href="#" alt="Indre et loire" onclick="MM_showHideLayers('dep37','','show')">
 <!-- 38 --><AREA shape=CIRCLE coords=267,219,7 href="#" alt=Isère onclick="MM_showHideLayers('dep69','','show')">
 <!-- 39 --><AREA shape=CIRCLE coords=270,169,7 href="#" alt=Jura onclick="MM_showHideLayers('dep21','','show')">
 <!-- 40 --><AREA shape=CIRCLE coords=98,271,7 href="#" alt=Landes onclick="MM_showHideLayers('dep33','','show')">
 <!-- 41 --><AREA shape=CIRCLE coords=160,141,7 href="#" alt="Loir et cher" onclick="MM_showHideLayers('dep37','','show')">
 <!-- 42 --><AREA shape=CIRCLE coords=229,205,7 href="#" alt=Loire onclick="MM_showHideLayers('dep69','','show')">
 <!-- 43 --><AREA shape=CIRCLE coords=223,230,7 href="#" alt="Haute loire" onclick="MM_showHideLayers('dep63','','show')">
 <!-- 44 --><AREA shape=CIRCLE coords=86,143,7 href="#" alt="Loire atlantique" onclick="MM_showHideLayers('dep44','','show')">
 <!-- 45 --><AREA shape=CIRCLE coords=184,128,7 href="#" alt=Loiret onclick="MM_showHideLayers('dep37','','show')">
 <!-- 46 --><AREA shape=CIRCLE coords=164,249,7 href="#" alt=Lot onclick="MM_showHideLayers('dep31','','show')">
 <!-- 47 --><AREA shape=CIRCLE coords=134,260,7 href="#" alt="Lot et garonne" onclick="MM_showHideLayers('dep33','','show')">
 <!-- 48 --><AREA shape=CIRCLE coords=215,253,7 href="#" alt=Lozere onclick="MM_showHideLayers('dep34','','show')">
 <!-- 49 --><AREA shape=CIRCLE coords=113,143,7 href="#" alt="Maine et loire" onclick="MM_showHideLayers('dep44','','show')">
 <!-- 50 --><AREA shape=CIRCLE coords=94,81,7 href="#" alt=Manche onclick="MM_showHideLayers('dep14','','show')">
 <!-- 51 --><AREA shape=CIRCLE coords=231,87,7 href="#" alt=Marne onclick="MM_showHideLayers('dep57','','show')">
 <!-- 52 --><AREA shape=CIRCLE coords=253,121,7 href="#" alt="Haute marne" onclick="MM_showHideLayers('dep57','','show')">
 <!-- 53 --><AREA shape=CIRCLE coords=109,118,7 href="#" alt=Mayenne onclick="MM_showHideLayers('dep44','','show')">
 <!-- 54 --><AREA shape=CIRCLE coords=279,98,7 href="#" alt="Meuthe et moselle" onclick="MM_showHideLayers('dep57','','show')">
 <!-- 55 --><AREA shape=CIRCLE coords=259,87,7 href="#" alt=Meuse onclick="MM_showHideLayers('dep57','','show')">
 <!-- 56 --><AREA shape=CIRCLE coords=48,123,7 href="#" alt=Morbihan onclick="MM_showHideLayers('dep35','','show')">
 <!-- 57 --><AREA shape=CIRCLE coords=291,84,7 href="#" alt=Moselle onclick="MM_showHideLayers('dep57','','show')">
 <!-- 58 --><AREA shape=CIRCLE coords=213,157,7 href="#" alt=Nièvre onclick="MM_showHideLayers('dep21','','show')">
 <!-- 59 --><AREA shape=CIRCLE coords=211,40,7 href="#" alt=Nord onclick="MM_showHideLayers('dep59','','show')">
 <!-- 60 --><AREA shape=CIRCLE coords=183,71,7 href="#" alt=Oise onclick="MM_showHideLayers('dep76','','show')">
 <!-- 61 --><AREA shape=CIRCLE coords=133,99,7 href="#" alt=Orne onclick="MM_showHideLayers('dep14','','show')">
 <!-- 62 --><AREA shape=CIRCLE coords=180,31,7 href="#" alt="Pas de calais" onclick="MM_showHideLayers('dep59','','show')">
 <!-- 63 --><AREA shape=CIRCLE coords=203,208,7 href="#" alt="Puy de dôme" onclick="MM_showHideLayers('dep63','','show')">
 <!-- 64 --><AREA shape=CIRCLE coords=100,301,7 href="#" alt="Pyrénées atlantiques" onclick="MM_showHideLayers('dep33','','show')">
 <!-- 65 --><AREA shape=CIRCLE coords=122,310,7 href="#" alt="Hautes pyrénées" onclick="MM_showHideLayers('dep31','','show')">
 <!-- 66 --><AREA shape=CIRCLE coords=191,324,7 href="#" alt="Pyrénées orientales" onclick="MM_showHideLayers('dep34','','show')">
 <!-- 67 --><AREA shape=CIRCLE coords=314,92,7 href="#" alt="Bas rhin" onclick="MM_showHideLayers('dep67','','show')">
 <!-- 68 --><AREA shape=CIRCLE coords=306,123,7 href="#" alt="Haut rhin" onclick="MM_showHideLayers('dep67','','show')">
 <!-- 69 --><AREA shape=CIRCLE coords=244,207,7 href="#" alt=Rhône onclick="MM_showHideLayers('dep69','','show')">
 <!-- 70 --><AREA shape=CIRCLE coords=278,135,7 href="#" alt="Haute saône" onclick="MM_showHideLayers('dep21','','show')">
 <!-- 71 --><AREA Shape=CIRCLE coords=239,172,7 href="#" alt="Saône et loire" onclick="MM_showHideLayers('dep21','','show')">
 <!-- 72 --><AREA Shape=CIRCLE coords=132,123,7 href="#" alt=Sarthe onclick="MM_showHideLayers('dep44','','show')">
 <!-- 73 --><AREA shape=CIRCLE coords=295,216,7 href="#" alt=Savoie onclick="MM_showHideLayers('dep69','','show')">
 <!-- 74 --><AREA shape=CIRCLE coords=294,192,7 href="#" alt="Haute savoie" onclick="MM_showHideLayers('dep69','','show')">
 <!-- 75 --><AREA shape=CIRCLE coords=265,25,7 href="#" alt=Paris onclick="MM_showHideLayers('dep94','','show')">
 <!-- 76 --><AREA shape=CIRCLE coords=150,61,7 href="#" alt="Seine maritime" onclick="MM_showHideLayers('dep76','','show')">
 <!-- 77 --><AREA shape=CIRCLE coords=200,101,7 href="#" alt="Seine et marne" onclick="MM_showHideLayers('dep94','','show')">
 <!-- 78 --><AREA  shape=CIRCLE coords=170,94,7 href="#" alt=Yvelynes onclick="MM_showHideLayers('dep94','','show')">
 <!-- 79 --><AREA shape=CIRCLE coords=116,177,7 href="#" alt="Deux sèvres" onclick="MM_showHideLayers('dep87','','show')">
 <!-- 80 --><AREA shape=CIRCLE coords=177,50,7 href="#" alt=Somme onclick="MM_showHideLayers('dep76','','show')">
 <!-- 81 --><AREA shape=CIRCLE coords=178,280,7 href="#" alt=Tarn onclick="MM_showHideLayers('dep31','','show')">
 <!-- 82 --><AREA shape=CIRCLE coords=151,272,7 href="#" alt="Tarn et garonne" onclick="MM_showHideLayers('dep31','','show')">
 <!-- 83 --><AREA shape=CIRCLE coords=288,292,7 href="#" alt=Var onclick="MM_showHideLayers('dep13','','show')">
 <!-- 84 --><AREA shape=CIRCLE coords=259,272,7 href="#" alt=Vaucluse onclick="MM_showHideLayers('dep13','','show')">
 <!-- 85 --><AREA shape=CIRCLE coords=92,172,7 href="#" alt=Vendée onclick="MM_showHideLayers('dep44','','show')">
 <!-- 86 --><AREA shape=CIRCLE coords=137,177,7 href="#" alt=Vienne onclick="MM_showHideLayers('dep87','','show')">
 <!-- 87 --><AREA shape=CIRCLE coords=154,205,7 href="#" alt="Haute vienne" onclick="MM_showHideLayers('dep87','','show')">
 <!-- 88 --><AREA shape=CIRCLE coords=287,115,7 href="#" alt=Vosges onclick="MM_showHideLayers('dep57','','show')">
 <!-- 89 --><AREA shape=CIRCLE coords=214,132,7 href="#" alt=Yonne onclick="MM_showHideLayers('dep21','','show')">
 <!-- 90 --><AREA shape=CIRCLE coords=309,150,7 href="#" alt="Territoire de belfort" onclick="MM_showHideLayers('dep21','','show')">
 <!-- 91 --><AREA shape=CIRCLE coords=191,107,7 href="#" alt=Essonne onclick="MM_showHideLayers('dep94','','show')">
 <!-- 92 --><AREA shape=CIRCLE coords=250,26,7 href="#" alt="Hauts de seine" onclick="MM_showHideLayers('dep94','','show')">
 <!-- 93 --><AREA shape=CIRCLE coords=285,20,7 href="#" alt="Seine saint denis" onclick="MM_showHideLayers('dep94','','show')">
 <!-- 94 --><AREA shape=CIRCLE coords=285,35,7 href="#" alt="Val de marne" onclick="MM_showHideLayers('dep94','','show')">
 <!-- 95 --><AREA shape=CIRCLE coords=183,85,7 href="#" alt="Val d'oise" onclick="MM_showHideLayers('dep94','','show')">
</MAP><IMG
      src="../images/France_acvg.gif" useMap=#FPMap0
border=0 width="382" height="342"></TD>
<td><p align="center">Guadeloupe<br>
  <img src="../images/acvg_guadeloupe.gif" width="84" height="90" onMouseOver="MM_showHideLayers('guadeloupe','','show')" onMouseOut="MM_showHideLayers('guadeloupe','','hide')"></p>
  </td>
<td><div align="center">Martinique<br>
      <img src="../images/acvg_martinique.gif" width="76" height="91" onMouseOver="MM_showHideLayers('martinique','','show')" onMouseOut="MM_showHideLayers('martinique','','hide')"></div></td>
</tr>
        <form id="form1" name="formulaire" method="post">
<tr>
<td align="right"><div align="center">Guyane<br>
      <img src="../images/acvg_guyane.gif" width="80" height="90" onMouseOver="MM_showHideLayers('guyane','','show')" onMouseOut="MM_showHideLayers('guyane','','hide')"></div></td>
<td align="right"><div align="center">R&eacute;union<br>
      <img src="../images/acvg_reunion.gif" width="84" height="89" onMouseOver="MM_showHideLayers('reunion','','show')" onMouseOut="MM_showHideLayers('reunion','','hide')"></div></td>
</tr>

<tr>
    <TD width="120" valign="top" align="left" nowrap rowspan="2">
    Département:<input type="text" id="departement" size="2" maxlength="2" name="departement">
    <TD width="200" valign="top" align="left" rowspan="2">
    <input type="image" border="0" name="I2" src="../images/consulter_base.gif" tabindex="2" onclick="showDpt();valid_formulaire()" >
 </form>
    <td ><div align="center">Mayotte<br>
        <img src="../images/acvg_mayotte.gif" width="72" height="90" onMouseOver="MM_showHideLayers('mayotte','','show')" onMouseOut="MM_showHideLayers('mayotte','','hide')"></div></td>
      <td><div align="center">St Pierre et Miquelon <br>
        <img src="../images/acvg_stpierre.gif" width="74" height="90" onMouseOver="MM_showHideLayers('miquelon','','show')" onMouseOut="MM_showHideLayers('miquelon','','hide')"></div></td>
  </tr>
<tr>
<td align="right">caledonie<br>
  <img src="../images/acvg_caledonie.gif" width="78" height="88" onMouseOver="MM_showHideLayers('caledonie','','show')" onMouseOut="MM_showHideLayers('caledonie','','hide')">  <br></td>
<td align="right">polynesie<br>
  <img src="../images/acvg_polynesie.gif" width="82" height="88" onMouseOver="MM_showHideLayers('polynesie','','show')" onMouseOut="MM_showHideLayers('polynesie','','hide')"></td>
</tr>
</table>

<% if request.form("departement")<>"" then %>
<SCRIPT language=JavaScript>
<!--
var myTable = [];
    myTable[01] = "dep69";
 myTable[02] = "dep76";
 myTable[03] = "dep63";
 myTable[04] = "dep13";
 myTable[05] = "dep13";
 myTable[06] = "dep13";
 myTable[07] = "dep69";
 myTable[08] = "dep57";
 myTable[09] = "dep31";
 myTable[10] = "dep57";
 myTable[11] = "dep34";
 myTable[12] = "dep31";
 myTable[13] = "dep13";
 myTable[14] = "dep14";
 myTable[15] = "dep63";
 myTable[16] = "dep87";
 myTable[17] = "dep87";
 myTable[18] = "dep37";
 myTable[19] = "dep87";
 myTable[21] = "dep21";
 myTable[22] = "dep35";
 myTable[23] = "dep87";
 myTable[24] = "dep33";
 myTable[25] = "dep21";
 myTable[26] = "dep69";
 myTable[27] = "dep76";
 myTable[28] = "dep37";
 myTable[29] = "dep35";
 myTable[30] = "dep34";
 myTable[31] = "dep31";
 myTable[32] = "dep32";
 myTable[33] = "dep33";
 myTable[34] = "dep34";
 myTable[35] = "dep35";
 myTable[36] = "dep37";
 myTable[37] = "dep37";
 myTable[38] = "dep69";
 myTable[39] = "dep21";
 myTable[40] = "dep33";
 myTable[41] = "dep37";
 myTable[42] = "dep69";
 myTable[43] = "dep63";
 myTable[44] = "dep44";
 myTable[45] = "dep37";
 myTable[46] = "dep31";
 myTable[47] = "dep33";
 myTable[48] = "dep34";
 myTable[49] = "dep44";
 myTable[50] = "dep14";
 myTable[51] = "dep57";
 myTable[52] = "dep57";
 myTable[53] = "dep44";
 myTable[54] = "dep57";
 myTable[55] = "dep57";
 myTable[56] = "dep35";
 myTable[57] = "dep57";
 myTable[58] = "dep21";
 myTable[59] = "dep59";
 myTable[60] = "dep76";
 myTable[61] = "dep14";
 myTable[62] = "dep59";
 myTable[63] = "dep63";
 myTable[64] = "dep33";
 myTable[65] = "dep34";
 myTable[66] = "dep13";
 myTable[67] = "dep67";
 myTable[68] = "dep67";
 myTable[69] = "dep69";
 myTable[70] = "dep21";
 myTable[71] = "dep21";
 myTable[72] = "dep44";
 myTable[73] = "dep69";
 myTable[74] = "dep69";
 myTable[75] = "dep94";
 myTable[76] = "dep76";
 myTable[77] = "dep94";
 myTable[78] = "dep94";
 myTable[79] = "dep87";
 myTable[80] = "dep76";
 myTable[81] = "dep31";
 myTable[82] = "dep31";
 myTable[83] = "dep13";
 myTable[84] = "dep13";
 myTable[85] = "dep44";
 myTable[86] = "dep87";
 myTable[87] = "dep87";
 myTable[88] = "dep57";
 myTable[89] = "dep21";
 myTable[90] = "dep21";
 myTable[91] = "dep94";
 myTable[92] = "dep94";
 myTable[93] = "dep94";
 myTable[94] = "dep94";
 myTable[95] = "dep94";
 myTable[98] = "dep2a";
 myTable[99] = "dep2a";
 
function showDpt(){
        var dpt = document.getElementById("departement").value;
        document.getElementById(myTable[dpt]).style.visibility = "visible";
  
     }
//-->
</SCRIPT>
<% end if %>
</BODY>
</HTML>

a votre bon coeur m'sieur dame

mercredi 16 janvier 2008 à 19:44:12 | Re : getElementById

PetoleTeam

Membre Club
Bonjour,

la fonction marche nickel
il reste des ERREURS
exemple la fct valid_formulaire de <input type="image" ne passe pas d'argument, comment faire pour récupérer theForm.dpt.value dans cette fonction ?

le calque s'affiche lorsqu'on valide le form, mais disparait aussitot...
normal tu le demande
onclick="showDpt();valid_formulaire(document.form1)" >

;0)
jeudi 17 janvier 2008 à 11:40:16 | Re : getElementById

isu_san

Bonjour,
la fonction marche nickel
je parle de la fonction que m'a proposé XtremDuke, qui marche tres bien tant qu'elle est pas intégrée dans ma page.

la fonction valid_formulaire etait en vrac, pas le bon nom de formulaire.... c'est remis en forme et maintenant ca va. J'ai remplacé le type="image" par un submit classique

function valid_formulaire(formulaire)
{


  if ((formulaire.departement.value =="")||(formulaire.departement.value =="00"))
  {
    alert("Veuillez indiquer le département.");
    formulaire.departement.focus();
    return (false);
  }
  if (formulaire.departement.value.length != 2)
  {
    alert("Le département doit comporter 2caractères.");
    formulaire.departement.focus();
    return (false);
  }
  if (formulaire.departement.value == "20")
  {
    alert("Pour la Corse veuillez saisir 2A ou 2B.");
    formulaire.departement.focus();
    return (false);
  }
    var d=formulaire.departement.value
      if ((isNaN(d)==true)&&(d!="2a")&&(d!="2b")&&(d!="2A")&&(d!="2B"))
  {
    alert("Le département doit être numérique");
    formulaire.departement.focus();
    return (false);
  }
var num_dep=formulaire.departement.value
  if ((num_dep == "96")||(num_dep == "99")||(num_dep == "98"))
  {
    alert("Le département "+num_dep+" n'est pas valide.");
    formulaire.departement.focus();
    return (false);
  }
  if (formulaire.departement.value == "97")
  {
    alert("Pas de direction anciens combattants pour le département 97.");
    formulaire.departement.focus();
    return (false);
  }
  return (gotolink(this.form));
}

le formulaire :

<form id="form1" name="formulaire" method="post" onsubmit="valid_formulaire(document.formulaire);showDpt()">
<tr>
    <TD width="120" valign="top" align="left" nowrap rowspan="2">
    Département:<input type="text" id="departement" size="2" maxlength="2" name="departement">
    <TD width="200" valign="top" align="left" rowspan="2">
    <input type="submit" value="consulter" border="0" name="I2" tabindex="2" >
 </form>

La validation se fait bien, mais le calque disparait toujours...
j'ai essayé en virant la validation, ca fait toujours pareil...

pourquoi apres showDpt(), le calque repasse en hidden ???

vendredi 18 janvier 2008 à 12:12:08 | Re : getElementById

PetoleTeam

Membre Club
Bonjour,
parce que...
lors de l'appui sur le bouton image ton formulaire est envoyé et le document se recharge.
Places un alert('Chargement du document'); dans la partie script et tu verras qu'il se recharge donc le calque repasse hidden...
;O)
lundi 21 janvier 2008 à 08:46:28 | Re : getElementById

isu_san

Salut, ok !!

Dois je en déduire qu'il n'y a pas de solution dans mon cas pour rendre le calque visible par le formulaire ?


1 2

Cette discussion est classée dans : getelementbyid, calques, département, martinique


Répondre à ce message

Sujets en rapport avec ce message

Position relative de calques... problèmeS [ par lunelautre ] [u]Bonjour j'ai des calques de menu (invisibles quand non actifs) dont la position est relative ... en fonction de la taille de la fenêtre du navigate Faire un clavier virtuel [ par davland7 ] Bonjour je fais un clavier virtuel pour un écran touch screen Bon pour les touche A, S, D etc. j'utilise ma fonction que je suis fait [code=js] fu comment ajouté une image suivant le lien [ par wiby35 ] Bonjour, alors pour vous sa vas surement parêtre simple ( moi et javascript = 2 voir 2 000 [^^confus5]) donc, sur un page j'utilise un " script" qui p pb avec un formulaire select [ par ahah38 ] Bonjour, J'ai besoin d'aide sur un formulaire select. Je souhaite réaliser un carnet de route en utilisant un formulaire select. Les visiteurs pourron En tête de page html : !DOCTYPE etc.. fait buguer un script. Pourquoi ? [ par tigre19 ] Bonjour, un petit script d'image suivant le curseur marche s'il n'y a pas d'en-tête !DOCTYPE mais ne marche plus dès que je la mets. Pourquoi ? ______ fonction avec en paramétre getElementById [ par kyoku59 ] Bonjour. Je flanche sur un problème surement évident mais impossible de trouver. Voilà j'ai une fonction avec en paramétre des éléments id de mon cod Commande Onclick agrandir image + afficher du texte [ par pharen ] bonjour à tous je souhaite réaliser une gallery photos ainsi les photos sont sur la page en petite taille. je click sur une photo et elle s'agrandit Problème getElementById [ par cybertaf ] Bonjour tout le monde. Voici mon problème: j'ai trouvé un script sur le net qui permet d'adapter la hauteur de deux DIV côte à côte. La DIV la plus p Javascript + html et php [ par j3r3m067 ] Bonjour à tous, Voilà je dois accélérer la vitesse de chargement d'une page php qui liste dans un repertoire, et qui me retourne un tableau. Ce que je bug affichage image avec firefox sur serveur [ par maher17 ] Bonjour tout le monde, dans le cadre de développement d'une application web avec php, j'ai eu besoin de quelque traitement sur les images à afficher t


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,420 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales