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

HTML Discussion :

Deux submits pour deux pages différentes


Sujet :

HTML

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    11
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2007
    Messages : 11
    Points : 13
    Points
    13
    Par défaut Deux submits pour deux pages différentes
    Bonjour,
    j'ai réalisé deux formulaires, chacun de ces formulaires envoies des données pour une page différente, seulement voila cela ne marche pas !!
    En effet il n'y a que le premier bouton submit qui envoit à la page qui lui correspond. Quand je sélectionne le deuxième bouton submit il revoit sur la mauvaise page.

    Voici mon code :

    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
     
    <html>
    <head>
    <script language="JavaScript" type="text/javascript">
     <!--
     function verif_formulaire()
     {
      if(document.commentaire.nom_comment.value == "")  {
        alert("Le champ 'Nom' a été laissé vide. Vous devez entrer votre nom. ");
        document.commentaire.nom_comment.focus();
        return false;
       } else {
        return true;
        }
       }
       //-->
     </script>
    <title>Visualisation des données</title> 
    <link rel="stylesheet" type="text/css" href="C:\wamp\www\essai\style.css" />
      <Basefont = 2>
     </head>
     <body>
     <form action="visualisation.php" method="POST" name="saisie">
     
     <font size=7 color=#FF0000>
     <U>
     <h1 align=center>Visualisation des donn&#233es</h1>
     </U>
     </font>
     <DIV align=center>
     <table border =10 cellspacing = 10 cellpadding = 2 >
     <tr>
     <th><font color=#0000FF>S&#233lection de l'ann&#233e :</font></th>
     <th><font color=#0000FF>S&#233lection du trimeste :</font></th>
     <th><font color=#0000FF>S&#233lection du service:</font></th>
     </tr>
     <td align=center><Select name = "ANNEE">
    	 <option value = "2001">2001</option>
    	 <option value = "2002">2002</option>
    	 <option value = "2003">2003</option>
    	 <option value = "2004">2004</option>
    	 <option value = "2005">2005</option>
    	 <option value = "2006">2006</option>
    	 <option value = "2007">2007</option>
    	 <option value = "2008">2008</option>
    	 <option value = "2009">2009</option>
    	 <option value = "2010">2010</option>
    	 <option value = "2011">2011</option>
    	 <option value = "2012">2012</option>
    	 <option value = "2013">2013</option>
    	 <option value = "2014">2014</option>
    	 <option value = "2015">2015</option>
    	 <option value = "2016">2016</option>
    	 <option value = "2017">2017</option>
    	 <option value = "2018">2018</option>
    	 <option value = "2019">2019</option>
    	 <option value = "2020">2020</option>
    	 <option value = "2021">2021</option>
    	 <option value = "2022">2022</option>
    	 <option value = "2023">2023</option>
    	 <option value = "2024">2024</option>
    	 <option value = "2025">2025</option>
    	 <option value = "2026">2026</option>
    	 <option value = "2027">2027</option>
    	 <option value = "2028">2028</option>
    	 <option value = "2029">2029</option>
    	 <option value = "2030">2030</option>
    	 </select>
     
      <ul>
      <td align=left><li><input type="radio" name="TRIMESTRE" value="1"/>1er<!--CHECKED-->
      <li><input type="radio" name="TRIMESTRE" value="2" />2&#232me
      <li><input type="radio" name="TRIMESTRE" value="3" />3&#232me
      <li><input type="radio" name="TRIMESTRE" value="4" />4&#232me
      </ul>
      <br>
      <font color=#0000FF >
     
      </font>
         <td align=center><Select name = "SERVICE">
    	 <option value = "1">Global</option>
    	 <option value = "2">ORL</option>
    	 <option value = "3">N&#233phroA</option>
    	 <option value = "4">N&#233phroB</option>
    	 <option value = "5">Anesth&#233sie</option>
    	 <option value = "6">Cardiologie</option>
    	 <option value = "7">CDV</option>
    	 <option value = "8">COT</option>
    	 <option value = "9">CTV</option>
    	 <option value = "10">H&#233pato-gastro</option>
    	 <option value = "11">MIT</option>
    	 <option value = "12">MAT</option>
    	 <option value = "13">M&#233decine interne</option>
    	 <option value = "14">Neurologie</option>
    	 <option value = "15">Oncologie</option>
    	 <option value = "16">Pneumologie</option>
    	 <option value = "16">Pneumo r&#233a</option>
    	 <option value = "18">Radioth&#233rapie</option>
    	 <option value = "19">Urgence</option>
    	 <option value = "20">Urgence m&#233decine</option>
    	 <option value = "21">Urologie</option>
    	 </select>
    	 </tr>
    	 </table>
    </DIV>
     
    <input type="hidden" name="action" value="ajouter"> 
    <p align=center>
    <input type="submit" name="submitButtonName" value="Soumettre" onClick="if( verif_formulaire() ) { this.disabled=true;this.value='Patientez...';document.commentaire.submit(); } 
    return false;">
    <input type="reset" value = "effacer et recomencer" ></p>
     
     
    <form action="pole.php" method="POST" name="view">
     <font size=7 color=#FF0000>
     <U>
     <h1 align=center>Bacteview</h1>
     </U>
     </font>
     <DIV align=center>
     <table border =10 cellspacing = 10 cellpadding = 2 >
     <tr>
     <th><font color=#0000FF>S&#233lection de l'ann&#233e :</font></th>
     </tr>
     <td align=center><Select name = "ANNEE">
    	 <option value = "2001">2001</option>
    	 <option value = "2002">2002</option>
    	 <option value = "2003">2003</option>
    	 <option value = "2004">2004</option>
    	 <option value = "2005">2005</option>
    	 <option value = "2006">2006</option>
    	 <option value = "2007">2007</option>
    	 <option value = "2008">2008</option>
    	 <option value = "2009">2009</option>
    	 <option value = "2010">2010</option>
    	 <option value = "2011">2011</option>
    	 <option value = "2012">2012</option>
    	 <option value = "2013">2013</option>
    	 <option value = "2014">2014</option>
    	 <option value = "2015">2015</option>
    	 <option value = "2016">2016</option>
    	 <option value = "2017">2017</option>
    	 <option value = "2018">2018</option>
    	 <option value = "2019">2019</option>
    	 <option value = "2020">2020</option>
    	 <option value = "2021">2021</option>
    	 <option value = "2022">2022</option>
    	 <option value = "2023">2023</option>
    	 <option value = "2024">2024</option>
    	 <option value = "2025">2025</option>
    	 <option value = "2026">2026</option>
    	 <option value = "2027">2027</option>
    	 <option value = "2028">2028</option>
    	 <option value = "2029">2029</option>
    	 <option value = "2030">2030</option>
    	 </select>
    </table>
    </DIV>
     
     <form action="pole.php" method="POST" name="view">	 
    <input type="submit" name="submitButtonName" value="Soumettre" onClick="if( verif_formulaire() ) { this.disabled=true;this.value='Patientez...';document.commentaire.submit(); } 
    return false;">
    <input type="reset" value = "effacer et recomencer" ></p>
    </body>
    </head>
    <html>
    Si vous pouvez me filez un petit coup de pouce ce serait cool !!
    Merci d'avance !!

  2. #2
    Membre éprouvé Avatar de sharrascript
    Homme Profil pro
    Développeur Web indépendant
    Inscrit en
    Avril 2007
    Messages
    678
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Web indépendant

    Informations forums :
    Inscription : Avril 2007
    Messages : 678
    Points : 1 042
    Points
    1 042
    Par défaut
    bonsoir,

    C'est normal, car à aucun moment tu ne ferme tes balises form (</form>)

    Si tu ne les ferme pas tu risque d'avoir des erreurs...

    ++
    LudiKreation Pour un web ludique et son Blog | CapRumbo pour un peu d'évasion | ChaOdisiaque Club Passion Rôliste |SierrElben le Jeu de rôle

Discussions similaires

  1. Réponses: 1
    Dernier message: 04/08/2011, 10h11
  2. Pré-requis pour deux workspaces sur deux server distincts?
    Par xav2229 dans le forum Administration et Installation
    Réponses: 1
    Dernier message: 22/01/2011, 09h01
  3. [MCD] Deux relations pour deux entités
    Par glen1789 dans le forum Schéma
    Réponses: 3
    Dernier message: 03/11/2009, 23h07
  4. Réponses: 10
    Dernier message: 21/11/2008, 15h52
  5. deux bouton submit pour un seul formulaire
    Par griese dans le forum Général JavaScript
    Réponses: 11
    Dernier message: 16/06/2006, 11h56

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