IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Servlets/JSP Java Discussion :

cacher un formulaire


Sujet :

Servlets/JSP Java

  1. #1
    Membre confirmé Avatar de piogo113
    Inscrit en
    Juin 2006
    Messages
    230
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2006
    Messages : 230
    Par défaut cacher un formulaire
    bonjour tout le monde

    j'ai 2 formulaire dans la meme page, et chaque formulaire a un bouton, ( afficher details et cacher details), je veux que ma page contient un seul formulaire, et que l'autre soit caché, et lorsqu'on appuit sur le bouton "afficher details", le 2éme formulaire s'affiche dans la meme page, et lorsqu'on appuit sur cacher, il revient sur le 1er formulaire.

    Merci

  2. #2
    Membre Expert Avatar de willoi
    Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2006
    Messages
    1 355
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Décembre 2006
    Messages : 1 355
    Par défaut
    Tu peux tout a fait faire ca en javascript(un peu comme ca) :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    function change_visibility(action){
    var tbl=document.getElementById('form_details');
     if (action=='cacher'){
       tbl.style.display='none';
     }else{
       tbl.style.display='inline';
     }
    }
    et dans tes boutons utilises onclick="change_visibility('cacher')" et onclick="change_visibility('montrer')"

  3. #3
    Membre confirmé Avatar de piogo113
    Inscrit en
    Juin 2006
    Messages
    230
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2006
    Messages : 230
    Par défaut
    Merci je vais essayer.

  4. #4
    Membre confirmé Avatar de piogo113
    Inscrit en
    Juin 2006
    Messages
    230
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2006
    Messages : 230
    Par défaut
    j'ai deja essayé la proposition mais ca marche pas.
    il faut deja quand j'execute dans le browser, faut que le 2éme formulaire soit cacher, et quand je clique sur le bouton afficher details le 2éme formulaire doit s'afficher dans la meme page.

  5. #5
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Le formulaire que tu veux cacher, tu le mets dans une balise div avec un style visibility:hidden comme ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    <div id="formulaire" style="visibility: hidden;">
    ...
    </div>
    Ensuite, sur le bouton "afficher details" tu ajoutes un attribut onclick pour exécuter une fonction javascript, comme te l'as déjà conseillé willoi.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <input type="button" name="bouton" value="afficher details" onclick="showFormulaire();">
    et la fonction javascript qui permet de rendre ton formulaire visible :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    <script>
      function showFormulaire() 
      { 
      document.getElementById("formulaire").style.visibility="visible"; 
      }
    </script>

  6. #6
    Membre confirmé Avatar de piogo113
    Inscrit en
    Juin 2006
    Messages
    230
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2006
    Messages : 230
    Par défaut
    Bon voila j'ai essayé le formulaire est caché, mais quand je clique sur le bouton ca marche toujours pas,
    comment faire pour qu'il fonctionne?

    merci pour votre aide.

  7. #7
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Montre ce que tu as codé, ce sera plus simple pour trouver pourquoi ça ne fonctionne pas.

  8. #8
    Membre confirmé Avatar de piogo113
    Inscrit en
    Juin 2006
    Messages
    230
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2006
    Messages : 230
    Par défaut
    Donc voila mon <body>

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     
    <body onLoad="getDt()">
     
      <script type="text/javascript" language="JavaScript1.2" src="stmenu.js"></script>
    <script type="text/javascript" language="JavaScript1.2">
    <!--
    stm_bm(["menu0f4d",730,"","blank.gif",0,"","",1,0,250,0,1000,1,0,0,"","80%",0,0,1,2,"default","hand",""],this);
    stm_bp("p0",[0,4,0,0,0,4,22,0,100,"",-2,"",-2,50,2,3,"#799BD8","transparent","060417line.gif",3,0,0,"#000000","",0,0,0,"transparent","",3,"060417buttona2.gif",26,5,0,"transparent","",3,"",0,0,0,"transparent","",3,"060417buttona1.gif",26,5,0,"transparent","",3,"","","",""]);
    stm_ai("p0i0",[0,"Catalogue","","",-1,-1,0,"#","_self","","","32px-Crystal_Clear_app_Linspire_Quickstart_Guide.png","32px-Crystal_Clear_app_Linspire_Quickstart_Guide.png",22,21,0,"","",0,0,0,1,1,"#FFFFF7",1,"#B5BED6",1,"","tabbluebutton.gif",2,3,0,0,"#FFFFF7","#000000","#66FFFF","#FF0000","bold 9pt Verdana","bold 9pt Verdana",0,0],150,0);
    stm_bp("p1",[0,4,0,0,4,4,0,0,100,"progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.32)",-2,"progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.32)",-2,78,0,0,"#799BD8","#EEEEEE","060417line1.gif",3,0,0,"#000000"]);
    stm_aix("p1i0","p0i0",[0,"Classification matériel","","",-1,-1,0,"","_self","","","","",0,0,0,"","",0,0,0,1,1,"#FFFFF7",1,"#B5BED6",1,"","",3,3,0,0,"#FFFFF7","#000000","#333399"],70,0);
    stm_aix("p1i1","p1i0",[0,"Matériel"],70,0);
    stm_ep();
    stm_aix("p0i1","p0i0",[0,"Paramétrage","","",-1,-1,0,"","_self","","","32px-Crystal_Clear_app_utilities.png","32px-Crystal_Clear_app_utilities.png",22,21,0,"","",0,0,0,1,1,"#FFFFF7",1,"#B5BED6",1,"","tabbluebutton.gif",3],150,0);
    stm_bpx("p2","p1",[]);
    stm_aix("p2i0","p1i0",[0,"Type matériel","","",-1,-1,0,"#"],70,26);
    stm_aix("p2i1","p2i0",[0,"Catégorie"],70,26);
    stm_aix("p2i2","p2i0",[0,"S_catégorie"],70,26);
    stm_aix("p2i3","p2i0",[0,"Marque"],70,26);
    stm_aix("p2i4","p2i0",[0,"Type"],70,26);
    stm_aix("p2i5","p2i0",[0,"Version"],70,26);
    stm_aix("p2i6","p1i0",[0,"Pays"],70,26);
    stm_aix("p2i7","p1i0",[0,"Pos admin"],70,26);
    stm_aix("p2i8","p1i0",[0,"Unité"],70,26);
    stm_aix("p2i9","p1i0",[0,"Fonction"],70,26);
    stm_aix("p2i10","p1i0",[0,"détenteur"],70,26);
    stm_aix("p2i11","p1i0",[0,"Type unité"],70,26);
    stm_aix("p2i12","p1i0",[0,"Province_wilaya"],70,26);
    stm_aix("p2i13","p1i0",[0,"Société"],70,26);
    stm_aix("p2i14","p1i0",[0,"Magasin"],70,26);
    stm_ep();
    stm_aix("p0i2","p0i1",[0,"Parc","","",-1,-1,0,"","_self","","","32px-Crystal_Clear_app_kword.png","32px-Crystal_Clear_app_kword.png"],150,0);
    stm_aix("p0i3","p0i1",[0,"Mouvement","","",-1,-1,0,"","_self","","","32px-Crystal_Clear_action_run.png","32px-Crystal_Clear_action_run.png"],150,0);
    stm_bpx("p3","p1",[]);
    stm_aix("p3i0","p2i0",[0,"Entrée"],100,26);
    stm_aix("p3i1","p2i0",[0,"Sortie"],100,26);
    stm_aix("p3i2","p2i0",[0,"Reversement"],100,26);
    stm_aix("p3i3","p1i0",[0,"Changement de position"],100,26);
    stm_ep();
    stm_aix("p0i4","p0i1",[0,"Recherche","","",-1,-1,0,"","_self","","","32px-Crystal_Clear_app_kappfinder.png","32px-Crystal_Clear_app_kappfinder.png"],150,0);
    stm_aix("p0i5","p0i1",[0,"Administrateur","","",-1,-1,0,"","_self","","","32px-Crystal_Clear_app_kuser.png","32px-Crystal_Clear_app_kuser.png"],150,0);
    stm_aix("p0i6","p0i1",[0,"Quitter","","",-1,-1,0,"","_self","","","32px-Crystal_Clear_action_exit.png","32px-Crystal_Clear_action_exit.png"],150,0);
    stm_ep();
    stm_sc(0,["transparent","transparent","","",3,3,0,0,"#FFFFF7","#000000","left_disabled.gif","left_enabled.gif",9,7,0,"right_disabled.gif","right_enabled.gif",9,7,0,1,907]);
    stm_em();
    //-->
    </script>
     
        <FORM name="horloge">
          <INPUT TYPE="text" NAME="display" SIZE=7 VALUE ="">
          </FORM>
          <br><form method="post" name="form1">
          <div align="center" class="style1"><font color="#ff0000"><strong>GESTION DU PARC</strong><br></font></div>
    <div align="center"><fieldset> 
    <legend> 
    <strong>Materiel</strong></legend><br> <form id="form1" name="form1" method="post" action="">
      <label>
      <div align="center">Désignation&nbsp;&nbsp;&nbsp;
        <select name="DESIGN_MAT" id="DESIGN_MAT">
        </select>
      </div>
      </label>
    </form><div align="left">
     
     
          </div></fieldset></div></form><br> 
     
    <form method="post" name="form2">
     
    <label><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Position Administrative &nbsp;</strong><strong>Quantité Existante&nbsp;</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Emplacement&nbsp;</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>Magazin&nbsp;</strong>&nbsp;&nbsp;<br />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="DESIGN_POS_ADMIN1" id="DESIGN_POS_ADMIN1" />
      <input type="text" name="QTE_EXIST1" id="QTE_EXIST1" />
      <input type="text" name="EMPLACEMENT1" id="EMPLACEMENT1" />
      <input type="text" name="DESIGN_MAG1" id="DESIGN_MAG1" />
      <input name="Afficher_details" type="button" id="Afficher_details" value="Afficher détails" onclick="showFormulaire();">
      <br />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="DESIGN_POS_ADMIN2" id="DESIGN_POS_ADMIN2" />
      <input type="text" name="QTE_EXIST2" id="QTE_EXIST2" />
      <input type="text" name="EMPLACEMENT2" id="EMPLACEMENT2" />
      <input type="text" name="DESIGN_MAG2" id="DESIGN_MAG2" />
      <br />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="DESIGN_POS_ADMIN3" id="DESIGN_POS_ADMIN3" />
      <input type="text" name="QTE_EXIST3" id="QTE_EXIST3" />
      <input type="text" name="EMPLACEMENT3" id="EMPLACEMENT3" />
      <input type="text" name="DESIGN_MAG3" id="DESIGN_MAG3" />
      <br />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="DESIGN_POS_ADMIN4" id="DESIGN_POS_ADMIN4" />
      <input type="text" name="QTE_EXIST4" id="QTE_EXIST4" />
      <input type="text" name="EMPLACEMENT4" id="EMPLACEMENT4" />
      <input type="text" name="DESIGN_MAG4" id="DESIGN_MAG4" />
      <br />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="DESIGN_POS_ADMIN5" id="DESIGN_POS_ADMIN5" />
      <input type="text" name="QTE_EXIST5" id="QTE_EXIST5" />
      <input type="text" name="EMPLACEMENT5" id="EMPLACEMENT5" />
      <input type="text" name="DESIGN_MAG5" id="DESIGN_MAG5" />
      <br />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="DESIGN_POS_ADMIN6" id="DESIGN_POS_ADMIN6" />
      <input type="text" name="QTE_EXIST6" id="QTE_EXIST6" />
      <input type="text" name="EMPLACEMENT6" id="EMPLACEMENT6" />
      <input type="text" name="DESIGN_MAG6" id="DESIGN_MAG6" />
      <br />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="DESIGN_POS_ADMIN7" id="DESIGN_POS_ADMIN7" />
      <input type="text" name="QTE_EXIST7" id="QTE_EXIST7" />
      <input type="text" name="EMPLACEMENT7" id="EMPLACEMENT7" />
      <input type="text" name="DESIGN_MAG7" id="DESIGN_MAG7" />
      <br />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="DESIGN_POS_ADMIN8" id="DESIGN_POS_ADMIN8" />
      <input type="text" name="QTE_EXIST8" id="QTE_EXIST8" />
      <input type="text" name="EMPLACEMENT8" id="EMPLACEMENT8" />
      <input type="text" name="DESIGN_MAG8" id="DESIGN_MAG8" />
      <br />
      </label>
     
     
    </form> 
     
    <form method="post" name="form3">
    <div id="form3" style="visibility: hidden;">
    <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Numero De Serie&nbsp;&nbsp;&nbsp;</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Unité
      </strong>
      <p>
        <label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="NUMERO_SERIE1" id="NUMERO_SERIE1" />
        <input type="text" name="QTE_EXIST9" id="QTE_EXIST9" />
        <input name="cacher_details" type="submit" class="style1" id="cacher_details" value="Cacher détails"  onclick="change_visibility('cacher')" />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="NUMERO_SERIE2" id="NUMERO_SERIE2" />
        <input type="text" name="QTE_EXIST9" id="QTE_EXIST10" />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="NUMERO_SERIE3" id="NUMERO_SERIE3" />
        <input type="text" name="QTE_EXIST9" id="QTE_EXIST11" />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="NUMERO_SERIE4" id="NUMERO_SERIE4" />
        <input type="text" name="QTE_EXIST9" id="QTE_EXIST12" />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="NUMERO_SERIE5" id="NUMERO_SERIE5" />
        <input type="text" name="QTE_EXIST9" id="QTE_EXIST13" />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="NUMERO_SERIE6" id="NUMERO_SERIE6" />
        <input type="text" name="QTE_EXIST9" id="QTE_EXIST14" />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="NUMERO_SERIE7" id="NUMERO_SERIE7" />
        <input type="text" name="QTE_EXIST9" id="QTE_EXIST15" />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="NUMERO_SERIE8" id="NUMERO_SERIE7" />
        <input type="text" name="QTE_EXIST9" id="QTE_EXIST16" />
        <br />
        </label>
    </div>
    <SCRIPT LANGUAGE="Javascript">
          <!--
          function getDt(){
          dt=new Date();
          hrs=dt.getHours();
          min=dt.getMinutes();
          sec=dt.getSeconds();
          tm=" "+((hrs<10)?"0":"") +hrs+":";
          tm+=((min<10)?"0":"")+min+":";
          tm+=((sec<10)?"0":"")+sec+" ";
          document.horloge.display.value=tm;
          setTimeout("getDt()",1000);
          }
          // -->
          </SCRIPT>
     
    </form>
    <script src="AC_RunActiveContent.js" type="text/javascript"></script>
       <script src="AC_ActiveX.js" type="text/javascript"></script> 
    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','103','height','24','hspace','180','title','Valider','src','button4','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','scale','noborder','movie','button4' ); //end AC code
        </script>
        <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" hspace="180" title="Valider">
          <param name="movie" value="button4.swf" />
          <param name="quality" value="high" />
          <param name="SCALE" value="noborder" />
          <embed src="button4.swf" width="103" height="24" hspace="180" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="noborder" ></embed>
        </object>
        </noscript>
        <script>
      function showFormulaire() 
      { 
      document.getElementById("form3").style.visibility="visible"; 
      }
    </script>
      </body>

  9. #9
    Membre confirmé Avatar de piogo113
    Inscrit en
    Juin 2006
    Messages
    230
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2006
    Messages : 230
    Par défaut
    Bonjour

    j'ai effectué un test simple sur 2 formulaires, le 2éme formulaire est caché, mais quand je clique sur le bouton afficher, ca donne rien

    voila le code associé:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     
    <body> 
        <form method="get" name="form1">
        <p align="center">&nbsp;form1</p>
        <p align="center">
        <input type="text" name="text2"></p>
        <p><input type="text" name="text3">
        <input type="text" name="text4">
        <input type="text" name="text5"> </p>
        <p>&nbsp;<input type="button" value="afficher" name="afficher" OnClick=showformulaire();></p>
        <p>&nbsp;</p><p>&nbsp;</p>
        </form><br><br>
        <form method="get" name="form2">
        <div id=fomr2" style="visibility: hidden;">
        <input type="text" name="text6"></p>
        <p><input type="text" name="text7">
        <input type="text" name="text8">
        <input type="button" value="cacher" name="cacher"> </p>
        </div>
        </form> 
        <script type="text/javascript">
        function showformulaire()
        {
        document.getElementById("form3").style.visibility="visible";
        }
        
        
        </script>
      </body>

  10. #10
    Membre éclairé
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    70
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2007
    Messages : 70
    Par défaut
    Peut-être que ceci marcherait mieux
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <input type="button" value="afficher" name="afficher" OnClick="javascript:showformulaire();">

  11. #11
    Membre confirmé Avatar de piogo113
    Inscrit en
    Juin 2006
    Messages
    230
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2006
    Messages : 230
    Par défaut
    Ca marche pas non plus, j'arrive pas à comprendre

  12. #12
    Membre éclairé
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    70
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2007
    Messages : 70
    Par défaut
    tu peux montrer ton code s'il te plait?

  13. #13
    Membre éclairé
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    70
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2007
    Messages : 70
    Par défaut
    je pense avoir trouver un autre problème a la ligne
    <div id=fomr2" style="visibility: hidden;">
    il manque un guillement après id= et ne serait-ce pa plutot form2 que fomr2?

  14. #14
    Membre confirmé Avatar de piogo113
    Inscrit en
    Juin 2006
    Messages
    230
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2006
    Messages : 230
    Par défaut
    je l'ai modifié mais ca n'a rien donné

  15. #15
    Membre habitué
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 13
    Par défaut
    voilà quelque chose de débuggé et qui fonctionne :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <body> 
        <form method="get" name="form1">
        <p align="center">&nbsp;form1</p>
        <p align="center">
        <input type="text" name="text2"></p>
        <p><input type="text" name="text3">
        <input type="text" name="text4">
        <input type="text" name="text5"> </p>
        <p>&nbsp;<input type="button" value="afficher" name="afficher" OnClick="showformulaire();"></p>
        <p>&nbsp;</p><p>&nbsp;</p>
        </form><br><br>
        <form method="get" name="form2">
        <div id="form2" style="visibility: hidden;">
        <input type="text" name="text6"></p>
        <p><input type="text" name="text7">
        <input type="text" name="text8">
        <input type="button" value="cacher" name="cacher" OnClick="hideformulaire();"> </p>
        </div>
        </form> 
        <script type="text/javascript">
        function showformulaire()
        {
        document.getElementById("form2").style.visibility="visible";
        }
        function hideformulaire()
        {
        document.getElementById("form2").style.visibility="hidden";
        }
        
        </script>
      </body>
    outre les problèmes de guillemets manquantes et de typo, tu appelais un element "form3" qui n'existait pas dans ton javascript. J'ai été grand seigneur je t'ai rajouté la methode qui cache ton formulaire

  16. #16
    Membre confirmé Avatar de piogo113
    Inscrit en
    Juin 2006
    Messages
    230
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2006
    Messages : 230
    Par défaut
    Ca marche pas cher ami, y'a quelque chose qui cloche!

  17. #17
    Membre éclairé
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    70
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2007
    Messages : 70
    Par défaut
    A quel moment cela ne fonctionne-t-il pas?
    Au moment du premier cgargement? au moment où tu veux afficher ton formulaire cacher?

  18. #18
    Membre confirmé Avatar de piogo113
    Inscrit en
    Juin 2006
    Messages
    230
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2006
    Messages : 230
    Par défaut
    le 2éme formulaire est caché, mais quand je clique sur afficher, ca ne donne rien.

  19. #19
    Membre éclairé
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    70
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2007
    Messages : 70
    Par défaut
    c bizarre je viens de tester le code et chez moi il fonctionne très bien.
    Tu utilises exactement le code fourni par Alicals?

  20. #20
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 313
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 313
    Billets dans le blog
    1
    Par défaut
    Pareil, il fonctionne très bien son code...
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. cacher un formulaire
    Par janluski dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 26/05/2009, 19h58
  2. Montrer/Cacher un formulaire dans un fieldset
    Par Goupo dans le forum Général JavaScript
    Réponses: 11
    Dernier message: 31/03/2009, 12h30
  3. [syntaxe] appel fonction pour cacher un formulaire
    Par helene38250 dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 26/11/2008, 11h58
  4. Cacher un formulaire ouvert
    Par ac264 dans le forum IHM
    Réponses: 3
    Dernier message: 12/10/2007, 13h56
  5. Afficher/cacher un formulaire
    Par mrttlemonde dans le forum Balisage (X)HTML et validation W3C
    Réponses: 1
    Dernier message: 24/03/2006, 18h54

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo