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

JavaScript Discussion :

exécution du "onsubmit"


Sujet :

JavaScript

  1. #1
    Membre Expert
    Avatar de laurentSc
    Homme Profil pro
    Webmaster débutant perpétuel !
    Inscrit en
    Octobre 2006
    Messages
    10 486
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Webmaster débutant perpétuel !
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2006
    Messages : 10 486
    Billets dans le blog
    1
    Par défaut exécution du "onsubmit"
    Bonjour, j'ai un problème bizarre : dans un formulaire, j'ai un onsubmit :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <form method="post" onsubmit="return toto(this);" action="form_mathias.php" enctype="application/x-www-form-urlencoded">
    (le nom "toto" est suite à un essai). J'ai bien un bouton de type submit et pourtant, la fonction "toto" n'est pas appelée : quelle pourrait être la raison ?

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Par défaut
    Enleve le "return"
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  3. #3
    Membre Expert
    Avatar de laurentSc
    Homme Profil pro
    Webmaster débutant perpétuel !
    Inscrit en
    Octobre 2006
    Messages
    10 486
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Webmaster débutant perpétuel !
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2006
    Messages : 10 486
    Billets dans le blog
    1
    Par défaut
    Je viens d'enlever le return :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <form method="post" onsubmit="toto(this);" action="form_mathias.php" enctype="application/x-www-form-urlencoded">
    , mais ce n'est pas mieux...

  4. #4
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 658
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 75
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 658
    Billets dans le blog
    1
    Par défaut
    non laisse le return ...
    ta fonction appelée devant retourner true ou false

    par contre ton form n'a pas de name ?
    Ma page Developpez - Mon Blog Developpez
    Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
    Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
    Votre post est résolu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de Développez !

  5. #5
    Membre Expert
    Avatar de laurentSc
    Homme Profil pro
    Webmaster débutant perpétuel !
    Inscrit en
    Octobre 2006
    Messages
    10 486
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Webmaster débutant perpétuel !
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2006
    Messages : 10 486
    Billets dans le blog
    1
    Par défaut
    Je viens de remettre le return, donné un nom au form et fait retourner true à toto :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <form name="test" method="post" onsubmit="return toto(this);" action="form_mathias.php" enctype="application/x-www-form-urlencoded">
    mais ce n'est pas mieux...

  6. #6
    Rédacteur

    Avatar de Bovino
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2008
    Messages
    23 647
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2008
    Messages : 23 647
    Billets dans le blog
    20
    Par défaut
    Tu pourrais montrer ta fonction toto ?
    Pas de question technique par MP !
    Tout le monde peut participer à developpez.com, vous avez une idée, contactez-moi !
    Mes formations video2brain : La formation complète sur JavaScriptJavaScript et le DOM par la pratiquePHP 5 et MySQL : les fondamentaux
    Mon livre sur jQuery
    Module Firefox / Chrome d'intégration de JSFiddle et CodePen sur le forum

  7. #7
    Membre Expert
    Avatar de laurentSc
    Homme Profil pro
    Webmaster débutant perpétuel !
    Inscrit en
    Octobre 2006
    Messages
    10 486
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Webmaster débutant perpétuel !
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2006
    Messages : 10 486
    Billets dans le blog
    1
    Par défaut
    toto, elle est toute bête :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    function toto(objForm) {
    alert("test");
    return(true);
    }
    et réalisant un bug, j'ai renommé le form objForm :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <form name="objForm" method="post" onsubmit="return toto(this);" action="form_mathias.php" enctype="application/x-www-form-urlencoded">
    mais ce n'est pas résolu...

  8. #8
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 658
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 75
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 658
    Billets dans le blog
    1
    Par défaut
    on peut voir le reste du code du form ?
    y'a un bouton submit ?
    tu soumets dynamiquement ???
    Ma page Developpez - Mon Blog Developpez
    Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
    Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
    Votre post est résolu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de Développez !

  9. #9
    Membre Expert
    Avatar de laurentSc
    Homme Profil pro
    Webmaster débutant perpétuel !
    Inscrit en
    Octobre 2006
    Messages
    10 486
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Webmaster débutant perpétuel !
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2006
    Messages : 10 486
    Billets dans le blog
    1
    Par défaut
    Le form complet est assez long :
    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
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    <form name="objForm" method="post" onsubmit="return toto(this);" action="form_mathias.php" enctype="application/x-www-form-urlencoded">
     
      <table border="0">
     
     
        <tbody>
     
     
        <tr>
     
     
            <td align="right">Last
    name<font color="red"><sup>*</sup></font></td>
     
     
            <td align="left" valign="top"><input class="wg-formfield" name="lastname" value="" maxlength="50" type="text"></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
          </tr>
     
       <tr>
     
     
            <td align="right">First
    name<font color="red"><sup>*</sup></font></td>
     
     
            <td align="left" valign="top"><input class="wg-formfield" name="firstname" value="" maxlength="50" type="text"></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
          </tr>
    	  <tr>
    	  </tr>
            <td align="right">Company<font color="red"><sup>*</sup></font></td>
     
     
            <td align="left" valign="top"><input class="wg-formfield" name="company" value="" maxlength="50" type="text"></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
          <tr>
     
     
            <td align="right">Entity<font color="red"><sup>*</sup></font></td>
     
     
            <td align="left" valign="top"><input class="wg-formfield" name="entity" value="" maxlength="50" type="text"></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
          </tr>
     
     
          <tr>
     
     
            <td align="right">Tel<font color="red"><sup>*</sup></font></td>
     
     
            <td align="left" valign="top"><input class="wg-formfield" name="tel" value="" maxlength="50" type="text"></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
          </tr>
    	        <tr>
            <td align="right">Title<font color="red"><sup>*</sup></font></td>
            <td align="left" valign="top"><input
     class="wg-formfield" name="title" value=""
     maxlength="50" type="text"></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td align="right">Employee ID : xxxxxx (5 or 6 figures) <font color="red"><sup>*</sup></font></td>
            <td align="left" valign="top"><input
     class="wg-formfield" name="sesa" value=""
     maxlength="50" type="text"></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
    	      <tr>
            <td align="right">Address <font color="red"><sup>*</sup></font></td>
            <td align="left" valign="top"><input
     class="wg-formfield" name="address" value=""
     maxlength="50" type="text"></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td align="right">ZIP Code <font color="red"><sup>*</sup></font></td>
            <td align="left" valign="top"><input
     class="wg-formfield" name="zip" value=""
     maxlength="50" type="text"></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td align="right">City <font color="red"><sup>*</sup></font></td>
            <td align="left" valign="top"><input
     class="wg-formfield" name="city" value=""
     maxlength="50" type="text"></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td align="right">Country <font color="red"><sup>*</sup></font></td>
            <td align="left" valign="top"><input
     class="wg-formfield" name="country" value=""
     maxlength="50" type="text"></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
     
     
    	      <tr>
     
     
            <td align="right">Email<font color="red"><sup>*</sup></font></td>
     
     
            <td align="left" valign="top"><input class="wg-formfield" name="email" value="" maxlength="50" type="text"></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td> (external format : ex
    :john.smith@schneider-electric.com) </td>
     
     
          </tr></table>
    	    <table>
     
     
          <tr>
     
     
            <td align="right">Check in<font color="red"><sup>*</sup></font></td>
     
     
            <td align="left">
     
            <select class="wg-formfield" name="day_arrival">
            <option class="wg-formfield" value="1" selected="selected">1</option>
            <option class="wg-formfield" value="2">2</option>
            <option class="wg-formfield" value="3">3</option>
            <option class="wg-formfield" value="4">4</option>
            <option class="wg-formfield" value="5">5</option>
            <option class="wg-formfield" value="6">6</option>
            <option class="wg-formfield" value="7">7</option>
            <option class="wg-formfield" value="8">8</option>
            <option class="wg-formfield" value="9">9</option>
            <option class="wg-formfield" value="10">10</option>
            <option class="wg-formfield" value="11">11</option>
            <option class="wg-formfield" value="12">12</option>
            <option class="wg-formfield" value="13">13</option>
            <option class="wg-formfield" value="14">14</option>
            <option class="wg-formfield" value="15">15</option>
            <option class="wg-formfield" value="16">16</option>
            <option class="wg-formfield" value="17">17</option>
            <option class="wg-formfield" value="18">18</option>
            <option class="wg-formfield" value="19">19</option>
            <option class="wg-formfield" value="20">20</option>
            <option class="wg-formfield" value="21">21</option>
            <option class="wg-formfield" value="22">22</option>
            <option class="wg-formfield" value="23">23</option>
            <option class="wg-formfield" value="24">24</option>
            <option class="wg-formfield" value="25">25</option>
            <option class="wg-formfield" value="26">26</option>
            <option class="wg-formfield" value="27">27</option>
            <option class="wg-formfield" value="28">28</option>
            <option class="wg-formfield" value="29">29</option>
            <option class="wg-formfield" value="30">30</option>
            <option class="wg-formfield" value="31">31</option>
            </select>
     
     
            </td>
     
     
            <td>/</td>
     
     
            <td>
     
            <select class="wg-formfield" name="month_arrival">
            <option class="wg-formfield" value="1" selected="selected">1</option>
            <option class="wg-formfield" value="2">2</option>
            <option class="wg-formfield" value="3">3</option>
            <option class="wg-formfield" value="4">4</option>
            <option class="wg-formfield" value="5">5</option>
            <option class="wg-formfield" value="6">6</option>
            <option class="wg-formfield" value="7">7</option>
            <option class="wg-formfield" value="8">8</option>
            <option class="wg-formfield" value="9">9</option>
            <option class="wg-formfield" value="10">10</option>
            <option class="wg-formfield" value="11">11</option>
            <option class="wg-formfield" value="12">12</option>
            </select>
     
     
            </td>
     
     
            <td>/</td>
     
     
            <td>2011</td>
     
     
          </tr>
     
     
          <tr>
     
     
            <td align="right">Check out<font color="red"><sup>*</sup></font></td>
     
     
            <td align="left">
     
            <select class="wg-formfield" name="day_start">
            <option class="wg-formfield" value="1" selected="selected">1</option>
            <option class="wg-formfield" value="2">2</option>
            <option class="wg-formfield" value="3">3</option>
            <option class="wg-formfield" value="4">4</option>
            <option class="wg-formfield" value="5">5</option>
            <option class="wg-formfield" value="6">6</option>
            <option class="wg-formfield" value="7">7</option>
            <option class="wg-formfield" value="8">8</option>
            <option class="wg-formfield" value="9">9</option>
            <option class="wg-formfield" value="10">10</option>
            <option class="wg-formfield" value="11">11</option>
            <option class="wg-formfield" value="12">12</option>
            <option class="wg-formfield" value="13">13</option>
            <option class="wg-formfield" value="14">14</option>
            <option class="wg-formfield" value="15">15</option>
            <option class="wg-formfield" value="16">16</option>
            <option class="wg-formfield" value="17">17</option>
            <option class="wg-formfield" value="18">18</option>
            <option class="wg-formfield" value="19">19</option>
            <option class="wg-formfield" value="20">20</option>
            <option class="wg-formfield" value="21">21</option>
            <option class="wg-formfield" value="22">22</option>
            <option class="wg-formfield" value="23">23</option>
            <option class="wg-formfield" value="24">24</option>
            <option class="wg-formfield" value="25">25</option>
            <option class="wg-formfield" value="26">26</option>
            <option class="wg-formfield" value="27">27</option>
            <option class="wg-formfield" value="28">28</option>
            <option class="wg-formfield" value="29">29</option>
            <option class="wg-formfield" value="30">30</option>
            <option class="wg-formfield" value="31">31</option>
            </select>
     
     
            </td>
     
     
            <td>/</td>
     
     
            <td>
     
            <select class="wg-formfield" name="month_start">
            <option class="wg-formfield" value="1" selected="selected">1</option>
            <option class="wg-formfield" value="2">2</option>
            <option class="wg-formfield" value="3">3</option>
            <option class="wg-formfield" value="4">4</option>
            <option class="wg-formfield" value="5">5</option>
            <option class="wg-formfield" value="6">6</option>
            <option class="wg-formfield" value="7">7</option>
            <option class="wg-formfield" value="8">8</option>
            <option class="wg-formfield" value="9">9</option>
            <option class="wg-formfield" value="10">10</option>
            <option class="wg-formfield" value="11">11</option>
            <option class="wg-formfield" value="12">12</option>
            </select>
     
     
            </td>
     
     
            <td>/</td>
     
     
            <td>2011</td>
     
     
          </tr>
     
     
        </table>
     
     <table>
     <tr>
    	  <td>Password : <input type="password"  value="your password" name="pwd0" onfocus="this.value=''"> Do <b>not</b> forget it !</td></tr>
     
     
          <tr>
     
     
            <td colspan="6">
     
      <div id="swfupload-control">
     
            <p>Upload an image files(jpg, png, gif), having maximum
    size of 10MB</p>
     
     
            <input id="button" type="button">
     
            <p id="queuestatus"></p>
     
     
     
            <ol id="log">
     
     
     
            </ol>
     
     
            </div>
     
     
            <br>
     
     
            <font color="red"><sup>*</sup></font>
    : mandatory field<br>
     
     
            </td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
          </tr>
    	  </table>
     
     
          <tr>
     
     
            <td colspan="2"><input value="Send" type="submit"></td>
     
     
          </tr>
     
     
     
        </tbody>
     
      </table>
     
     
    </form>
    mais il a bien un bouton "submit" et ce qui est bizarre, c'est qu'avant, ça marchait, mais je ne trouve ce qui s'est produit.

  10. #10
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 658
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 75
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 658
    Billets dans le blog
    1
    Par défaut
    oulàlàksémoche !!!!!!!!
    c'est horrible ce table pour la mise en page

    ça sent les balises mal balancées ...
    Ma page Developpez - Mon Blog Developpez
    Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
    Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
    Votre post est résolu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de Développez !

  11. #11
    Membre Expert
    Avatar de laurentSc
    Homme Profil pro
    Webmaster débutant perpétuel !
    Inscrit en
    Octobre 2006
    Messages
    10 486
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Webmaster débutant perpétuel !
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2006
    Messages : 10 486
    Billets dans le blog
    1
    Par défaut
    C'est peut-être pas très joli (cela dit, vu qu'il faut bien faire une mise en page, je ne vois pas d'autre solution), mais j'ai bien simplifié :
    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
     
     
      <script language="JavaScript">
    function toto(objForm) {
    alert("test");
    return(true);
    }
      </script>
    <form name="objForm" method="post" onsubmit="return toto(this);" action="form_mathias.php" enctype="application/x-www-form-urlencoded">
      <table border="0">
     
     
        <tbody>
     
     
        <tr>
     
     
            <td align="right">Last
    name<font color="red"><sup>*</sup></font></td>
     
     
            <td align="left" valign="top"><input class="wg-formfield" name="lastname" value="" maxlength="50" type="text"></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
          </tr>
     
       <tr>
     
     
            <td align="right">First
    name<font color="red"><sup>*</sup></font></td>
     
     
            <td align="left" valign="top"><input class="wg-formfield" name="firstname" value="" maxlength="50" type="text"></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
            <td></td>
     
     
          </tr>
    	  <tr>
    	  <td>Password : <input type="password"  value="your password" name="pwd0" onfocus="this.value=''"> Do <b>not</b> forget it !</td><td></td>
     
     
    <td></td>
     
     
    <td></td>
     
     
    <td></td>
    </tr>
     
    </table>	  
     
     
    <input value="Send" type="submit">
    </form>
    et le problème reste.

  12. #12
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 198
    Par défaut
    Bonjour,
    Citation Envoyé par laurentSc
    ...la fonction "toto" n'est pas appelée...
    vérifies également le reste de ton javascript, une erreur à l'intérieur et adieu...

  13. #13
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 658
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 75
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 658
    Billets dans le blog
    1
    Par défaut
    C'est peut-être pas très joli (cela dit, vu qu'il faut bien faire une mise en page, je ne vois pas d'autre solution), mais j'ai bien simplifié :

    Pour information la mise en page se fait avec des div des span des p et du css ...
    Les balises tables devraient être réservées aux données tabulaires.
    Il se peut d'ailleurs que le table masque certains éléments du form pour le DOM...
    Ma page Developpez - Mon Blog Developpez
    Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
    Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
    Votre post est résolu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de Développez !

  14. #14
    Expert confirmé
    Avatar de javatwister
    Homme Profil pro
    danseur
    Inscrit en
    Août 2003
    Messages
    3 684
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : danseur

    Informations forums :
    Inscription : Août 2003
    Messages : 3 684
    Par défaut
    au cas où, tu pourrais nous mettre le vrai contenu de toto();
    (parce que là, c'est une blague, hein? rassure-moi);

    à part ça, je rappelle qu'un formulaire n'a pas de name;

    et puis à l'heure actuelle, le this en paramètre est inutile;

    et puis encore, le fait de confondre le nom de l'argument et sa valeur (supposée, d'ailleurs...) me paraît peu pertinent;

  15. #15
    Membre Expert
    Avatar de laurentSc
    Homme Profil pro
    Webmaster débutant perpétuel !
    Inscrit en
    Octobre 2006
    Messages
    10 486
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Webmaster débutant perpétuel !
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2006
    Messages : 10 486
    Billets dans le blog
    1
    Par défaut
    Bonjour,
    vérifies également le reste de ton javascript, une erreur à l'intérieur et adieu...
    C'était bien ça : une parenthèse en trop.

+ Répondre à la discussion
Cette discussion est résolue.

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