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 :

fonction de répartition d'un montant


Sujet :

JavaScript

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2007
    Messages
    197
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Conseil

    Informations forums :
    Inscription : Avril 2007
    Messages : 197
    Par défaut fonction de répartition d'un montant
    Bonjour à tous, pour les besoins de mon site, j'ai été amené à créer une fonction en javascript qui répartie un montant entré dans un champs de type texte (montantacompte) entre plusieurs postes issus d'un ensemble de facture répartis selon divers textes de lois, en fait cela se présente sous la forme du tableau sous jacent:

    Nom : Sans titreeeeee.png
Affichages : 150
Taille : 1,70 Mo

    le script que j'ai fonctionnait parfaitement, je ne sais pas pourquoi mais il ne fonctionne plus comme avant.

    Tout d'abord voici le script:

    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
     <script type="text/javascript">
     function getItems()
     {
     var items = new Array();
     var itemCount = document.getElementsByClassName("items");
     
     for(var i = 0; i < itemCount.length; i++)
     {
         items[i] = document.getElementById("p" + (i+1)).value;
     }
     
     return items;
     }
     
     function setItems(items,payAmt)
     {
       //document.getElementById("montantacompte").value = payAmt;
       for(var i = 0; i < items.length; i++)
       {
          document.getElementById("p" + (i+1)).value = Math.round(items[i]*100)/100;
       }
     }
     
     function itemSum(items)
     {
    var sum = 0;
     
    for(var i=0; i < items.length; i++)
    {
        sum = items[i] + sum;
    }
     
    return sum;
     }
     
     function payment(montantacompte)
     {
     var items = getItems();
     var payAmt = document.getElementById("montantacompte").value;
     var i = 0;
     var sum = itemSum(items);
     
     while(payAmt != 0 && sum != 0)
     {
         var temp = items[i] - payAmt;
         if(temp > 0)
         {
             items[i] = temp;
             break;
         }
         else if(temp < 0)
         {
             items[i] = 0;
             payAmt = temp*-1;
          }
         i++;
         sum = itemSum(items);
     }
     
      setItems(items, payAmt);
     }
     
    </script>
    donc toute la colonne de gauche intitulée montant initial, chaque champs porte une id allant de a1 à a13

    pour le champ montant imputé, en fait il réparti l'acompte entre les différents postes, par exemple si j'ai 1500 € en principal et que j'ai 1000€ d'acompte alors apparaîtra 1000 € dans ce champs en revanche si l'acompte est supérieur apparaîtra bien plus mais pas plus que le montant initial.

    Ces champs sont identifies par une id allant de r1 à r13.

    Et dans la colonne suivant montant restant apparaît la différence entre ce qui est initialement et ce qui reste. ces colonnes sont identifiées de p1 à p13.

    par exemple si dans le passé il y a déjà eu un acompte ces montants sont repris dans ce qui restait.

    Le soucis que j'ai c'est que systématiquement le script travail avec 19254 même si dans montant acompte je ne mets que 50€ ou 1 €. Je ne comprend pas pourquoi car dans le champs montant acompte il est bien repris dans le script grâce a son id.

    par avance merci pour votre aide.

  2. #2
    Membre Expert

    Homme Profil pro
    Ingénieur Hospitalier
    Inscrit en
    Juillet 2004
    Messages
    993
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur Hospitalier
    Secteur : Santé

    Informations forums :
    Inscription : Juillet 2004
    Messages : 993
    Billets dans le blog
    1
    Par défaut
    Salut, est-ce trop te demander de copier coller la partie html générée?
    Explicité du code source, est un moyen plus claire qu'une simple image, elle nous renseigne pas sur les id de test éléments et les rapports concrets avec ton script js.
    Merci a+.

  3. #3
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2007
    Messages
    197
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Conseil

    Informations forums :
    Inscription : Avril 2007
    Messages : 197
    Par défaut
    voici le code principal:

    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
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
     
    <form action="#" method="post"><fieldset  style="background:#FFF" ><legend><strong>Versement</strong>:</legend>
    <input type="hidden" name="n_doss" value="120015660012" />
    <input type="hidden" name="etat" value="3" />
     
    <strong>Dossier:</strong> 120015660012  - <strong>Affaire:</strong> S.A.S. PRO<strong> c/</strong> AC L'art de Construire
    <table width="79%" height="347" class="month" style="width:100%; height:150px" >
    <tr><td width="7%" bgcolor="#99CCCC" ><p align="center"><strong>ORDRE</strong></p></td><td width="13%" bgcolor="#99CCCC" ><p align="center"><strong>LIBELLE</strong></p></td><td width="10%" bgcolor="#99CCCC" ><p align="center"><strong>MONTANT INITIAL</strong></p></td><td width="10%" bgcolor="#99CCCC" ><p align="center"><strong>MONTANT IMPUT&Eacute;</strong></p></td><td width="10%" bgcolor="#99CCCC" ><p align="center"><strong>MONTANT RESTANT</strong></p></td><td width="10%" bgcolor="#99CCCC" ><p align="center"><strong>PRO</strong></p></td><td width="10%" bgcolor="#99CCCC" ><p align="center"><strong>CLIENT</strong></p></td></tr>
    <tr>
    	<td bgcolor="#FAFAFA">	  	  <input name="ordre_principal" type="text" id="ordre_principal" value="1" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">PRINCIPAL</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="principal" type="hidden" id="m1" value="16058.82" readonly="readonly"  /><input name="a1" type="text" id="a1" value="16058.82" size="10" />
     </td>
             <td bgcolor="#FAFAFA"><input  type="text" id="r1" size="10"   /></td>
        <td bgcolor="#FAFAFA"><input type="text" name="principal_s" id="p1" value="0.00" class="items" size="10"   /></td>
       <td bgcolor="#FAFAFA"> <input type="text" id="nprincipal" name="nprincipal" size="10" /></td>
       <td bgcolor="#FAFAFA"> <input type="text" id="vprincipal" name="vprincipal"  size="10" /></td>
    </tr>
    <tr>
    <td bgcolor="#FAFAFA"><input name="ordre_interets" type="text" id="ordre_interets" value="2" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">INT&Eacute;R&Ecirc;TS</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="interets" type="hidden" id="m2" value="2.49" readonly="readonly"  /><input name="interets" type="text" id="a2" value="2.49" size="10" readonly="readonly"  />
        </td>
         <td bgcolor="#FAFAFA"><input type="text" id="r2" size="10" />
        </td>
        <td bgcolor="#FAFAFA"><input name="interets_s" type="text" class="items" id="p2" value="0.00" size="10" />
        </td>
          <td bgcolor="#FAFAFA"><input name="ninterets" type="text"  id="ninterets" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vinterets" type="text"  id="vinterets" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_clause_penale" type="text" id="ordre_clause_penale" value="3" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">CLAUSE P&Eacute;NALE</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="clause_penale" type="text" id="a3" value="400.00" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r3" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="clause_penale_s" type="text" class="items" id="p3" value="0.00" size="10"  />
        </td>
         <td bgcolor="#FAFAFA"><input name="nclause_penale" type="text"  id="nclause_penale" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vclause_penale" type="text"  id="vclause_penale" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_domages_interets2" type="text" id="ordre_domages_interets" value="4" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">DOMMAGES ET INT&Eacute;R&Ecirc;TS</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="domages_interets" type="text" id="a4" value="400.00" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r4" size="10" />
        </td>
          <td bgcolor="#FAFAFA"><input name="domages_interets_s" type="text" class="items" id="p4" value="0.00" size="10" />
        </td>
         <td bgcolor="#FAFAFA"><input name="ndomages_interets_s" type="text"  id="ndomages_interets" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vdomages_interets_s" type="text"  id="vdomages_interets" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_art700_cpc" type="text" id="ordre_art700_cpc" value="5" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">ART 700 DU CPC</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="art700_cpc" type="text" id="a5" value="150.00" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r5" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="art700_cpc_s" type="text" class="items" id="p5" value="0.00" size="10"  />
        </td>
           <td bgcolor="#FAFAFA"><input name="nart700_cpc" type="text"  id="nart700_cpc" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vart700_cpc" type="text"  id="vart700_cpc" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_art475_1_cpp" type="text" id="ordre_art475_1_cpp" value="6" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">ART 475-1 DU CPP</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="art475_1_cpp" type="text" id="a6" value="75.00" size="10" readonly="readonly"  />
        </td>
         <td bgcolor="#FAFAFA"><input type="text" id="r6" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="art475_1_cpp_s" type="text" class="items" id="p6" value="0.00" size="10"  />
        </td>
           <td bgcolor="#FAFAFA"><input name="nart475_1_cpp" type="text"  id="nart475_1_cpp" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vart475_1_cpp" type="text"  id="vart475_1_cpp" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_art_441_6_cc" type="text" id="ordre_art_441_6_cc" value="7" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">ART 441-6 DU CC</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="art_441_6_cc" type="text" id="a7" value="85.25" size="10" readonly="readonly"  />
        </td>
         <td bgcolor="#FAFAFA"><input type="text" id="r7" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="art_441_6_cc_s" type="text" class="items" id="p7" value="0.00" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="nart_441_6_cc" type="text"  id="nart_441_6_cc" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vart_441_6_cc" type="text"  id="vart_441_6_cc" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_frais_ar" type="text" id="ordre_frais_ar" value="8" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">FRAIS D'AR</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="frais_ar" type="text" id="a8" value="4.33" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r8" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="frais_ar_s" type="text" class="items" id="p8" value="0.00" size="10"  />
        </td>
         <td bgcolor="#FAFAFA"><input name="nfrais_ar" type="text"  id="nfrais_ar" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vfrais_ar" type="text"  id="vfrais_ar" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_agios" type="text" id="ordre_agios" value="9" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">FRAIS ET AGIOS</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="agios" type="text" id="a9" value="257.00" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r9" size="10" />
        </td>
         <td bgcolor="#FAFAFA"><input name="agios_s" type="text" class="items" id="p9" value="0.00" size="10" />
        </td>
          <td bgcolor="#FAFAFA"><input name="nagios" type="text"  id="nagios" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vagios" type="text"  id="vagios" size="10" /></td>
    </tr>
    <tr><td width="3" bgcolor="#FAFAFA"><input name="ordre_depens" type="text" id="ordre_depens" value="10" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">DEPENS</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="depens" type="text" id="a10" value="362.38" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r10" size="10"  />
        </td>
         <td bgcolor="#FAFAFA"><input name="depens_s" type="text" class="items" id="p10" value="0.00" size="10"  />
        </td>
              <td bgcolor="#FAFAFA"><input name="ndepens" type="text"  id="ndepens" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vdepens" type="text"  id="vdepens" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_frais_execution" type="text" id="ordre_frais_execution" value="11" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">FRAIS D'EX&Eacute;XUTION</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="frais_execution" type="text" id="a11" value="968.11" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r11" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="frais_execution_s" type="text" class="items" id="p11" value="0.00" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="nfrais_execution" type="text"  id="nfrais_execution" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vfrais_execution" type="text"  id="vfrais_execution" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_contrib_aid_juridiq" type="text" id="ordre_contrib_aid_juridiq" value="12" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">CONTRIBUTION A L'AIDE JURIDIQUE</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="contrib_aid_juridiq" type="text" id="a12" value="149.12" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r12" size="10" />
        </td>
          <td bgcolor="#FAFAFA"><input name="contrib_aid_juridiq_s" type="text" class="items" id="p12" value="0.00" size="10" />
        </td>
        <td bgcolor="#FAFAFA"><input name="ncontrib_aid_juridiq" type="text"  id="ncontrib_aid_juridiq" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vcontrib_aid_juridiq" type="text"  id="vcontrib_aid_juridiq" size="10" /></td>
    </tr>
    <tr><td width="3" bgcolor="#FAFAFA"><input name="ordre_frais_greffe" type="text" id="ordre_frais_greffe" value="13" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">FRAIS DE GREFFE</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="frais_greffe" type="text" id="a13" value="4.33" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r13" size="10"  />
        </td>
         <td bgcolor="#FAFAFA"><input name="frais_greffe_s" type="text" class="items" id="p13" value="0.00" size="10"  />
        </td>
         <td bgcolor="#FAFAFA"><input name="nfrais_greffe" type="text"  id="nfrais_greffe" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vfrais_greffe" type="text"  id="vfrais_greffe" size="10" /></td>
    </tr>
     
    </table><hr>
      <table width="100%" class="contacts">
      <tr>
        <td width="38" class="contactDept"><p align="center"><strong>DATE</strong></p></td><td width="215" class="contactDept"><p align="center"><strong>MODE</strong></p></td><td width="232" class="contactDept"><p align="center"><strong>MONTANT</strong></p></td><td width="257" class="contactDept"><p align="center"><strong>PAIEMENT</strong></p></td></tr>
          <tr>
            <td align="center"><p align="center"><input name="date_reception" type="text" id="date_reception" value="" size="5"  /></p></td><td align="center"><p align="center"><select name="mode"><option value="CHEQUE DEBITEUR">CHEQUE DEBITEUR</option><option value="CHEQUE CARPA">CHEQUE CARPA</option><option value="VIREMENT">VIREMENT</option><option value="MANDAT CASH">MANDAT CASH</option><option value="MANDAT COMPTE">MANDAT COMPTE</option><option value="MANDAT ADMINISTRATIF">MANDAT ADMINISTRATIF</option><option value="CB A AGENT">CARTE BLEUE AVEC UN AGENT</option><option value="CB SUR SITE">CARTE BLEUE SUR LE SITE</option> </select></p></td><td><p align="center">   
     <script type="text/javascript">
     function imputed()
    {
    var a1= document.getElementById("a1").value;
    var a2= document.getElementById("a2").value;
    var a3= document.getElementById("a3").value;
    var a4= document.getElementById("a4").value;
    var a5= document.getElementById("a5").value;
    var a6= document.getElementById("a6").value;
    var a7= document.getElementById("a7").value;
    var a8= document.getElementById("a8").value;
    var a9= document.getElementById("a9").value;
    var a10= document.getElementById("a10").value;
    var a11= document.getElementById("a11").value;
    var a12= document.getElementById("a12").value;
    var a13= document.getElementById("a13").value;
    var p1= document.getElementById("p1").value;
    var p2= document.getElementById("p2").value;
    var p3= document.getElementById("p3").value;
    var p4= document.getElementById("p4").value;
    var p5= document.getElementById("p5").value;
    var p6= document.getElementById("p6").value;
    var p7= document.getElementById("p7").value;
    var p8= document.getElementById("p8").value;
    var p9= document.getElementById("p9").value;
    var p10= document.getElementById("p10").value;
    var p11= document.getElementById("p11").value;
    var p12= document.getElementById("p12").value;
    var p13= document.getElementById("p13").value;
     
    document.getElementById('r1').value=Math.round((a1-p1)*100)/100;
    document.getElementById('r2').value=Math.round((a2-p2)*100)/100;
    document.getElementById('r3').value=Math.round((a3-p3)*100)/100;
    document.getElementById('r4').value=Math.round((a4-p4)*100)/100;
    document.getElementById('r5').value=Math.round((a5-p5)*100)/100;
    document.getElementById('r6').value=Math.round((a6-p6)*100)/100;
    document.getElementById('r7').value=Math.round((a7-p7)*100)/100;
    document.getElementById('r8').value=Math.round((a8-p8)*100)/100;
    document.getElementById('r9').value=Math.round((a9-p9)*100)/100;
    document.getElementById('r10').value=Math.round((a10-p10)*100)/100;
    document.getElementById('r11').value=Math.round((a11-p11)*100)/100;
    document.getElementById('r12').value=Math.round((a12-p12)*100)/100;
    document.getElementById('r13').value=Math.round((a13-p13)*100)/100;	
    }
     function hono(p1,p2,p3,p4,t1,t2,t3,type,versement,montantacompte)
     {
    	 var p1		 		= 5000.00;
     	 var p2		 		= 5000.01;
     	 var p3 			= 8000.00;
    	 var p4 			= 8000.01;
    	 var t1			 	= 17.00;
    	 var t2 			= 10.00;
    	 var t3 			= 6.00;
    	 var type			= "d";
     	 var versement  	= 0;
    	 var montantacompte	= document.getElementById("montantacompte").value;
     
     
    	 if (type== "d")
    	 	{
    			if(versement== 0.00 && montantacompte <= p1)
    			{
    				reste1= montantacompte;
    				pc= t1/100;
    				taux1= pc+1;
    				h1=((reste1*taux1)-reste1);
    				honoraires=h1;
    				document.getElementById('taux-1').value=t1;
    				document.getElementById('palier1').value=Math.round(h1*100)/100;
    				document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    			}
    			else if(versement < p1 && (versement + montantacompte) <= p1)
    			{
    				reste1= montantacompte;
    				pc= t1/100;
    				taux1= pc+1;
    				h1= (reste1*taux1)-reste1;
    				honoraires= h1;
    				document.getElementById('taux-1').value=t1;
    				document.getElementById('palier1').value=Math.round(h1*100)/100;
    				document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    			}
    			else if(versement <= p1 && (versement+montantacompte)>= p2 && (versement+montantacompte)<=p3)
    			{
    				reste1=p1-versement;
    				pc=t1/100;
    				taux1=pc+1;
    				h1=(reste1*taux1)-reste1;
    				reste2=montantacompte-reste1;
    				pc2=t2/100;
    				taux2=pc2+1;
    				h2=(reste2*taux2)-reste2;
    				honoraires=h1+h2;
    				document.getElementById('taux-1').value=t1;
    				document.getElementById('palier1').value=Math.round(h1*100)/100;
    				document.getElementById('taux-2').value=t2;
    				document.getElementById('palier2').value=Math.round(h2*100)/100;
    				document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    			}
    			else if (versement==0.00 && montantacompte>=p2 && montantacompte <=p3)
    			{
    				reste2=montantacompte-p1;
    				reste1=p1;
    				pc=(t1/100);
    				taux1=pc+1;
    				h1=((reste1*taux1)-reste1);
    				pc2=(t2/100);
    				taux2=pc2+1;
    				h2=((reste2*taux2)-reste2);
    				honoraires=(h1+h2);
    				document.getElementById('taux-1').value=t1;
    				document.getElementById('palier1').value=Math.round(h1*100)/100;
    				document.getElementById('taux-2').value=t2;
    				document.getElementById('palier2').value=Math.round(h2*100)/100;
    				document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    			}
    			else if(versement<=p3 && versement>=p2 && (versement+montantacompte)>=p2 && (versement+montantacompte)<=p3)
    			{
    			reste1=montantacompte;
    			pc=(t2/100);
    			taux1=pc+1;
    			h1=((reste1*taux1)-reste1);
    			honoraires=h1;	
    			document.getElementById('taux-1').value=t1;
    			document.getElementById('palier1').value=Math.round(h1*100)/100;
    			document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    			}
    			else if(versement>=p2 && versement<=p3 && (versement+montantacompte)>=p4)
    			{
    			reste1=p4-versement;
    			pc=(t2/100);
    			taux2=pc+1;
    			h2=((reste1*taux2)-reste1);
    			reste2=montantacompte-reste1;
    			pc2=(t3/100);
    			taux3=pc2+1;
    			h3=((reste2*taux3)-reste2);
    			honoraires=(h2+h3);
    			document.getElementById('taux-3').value=t3;
    			document.getElementById('palier3').value=Math.round(h3*100)/100;
    			document.getElementById('taux-2').value=t2;
    			document.getElementById('palier2').value=Math.round(h2*100)/100;
    			document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    		}
    		else if(versement==0.00 && montantacompte>=p4)
    		{
    			reste1=p1;
    			reste2=p3-p2;
    			pc=(t1/100);
    			taux1=pc+1;
    			h1=((reste1*taux1)-reste1);
    			pc2=(t2/100);
    			taux2=pc2+1;
    			h2=((reste2*taux2)-reste2);
    			reste3=(montantacompte-reste1-reste2);
    			pc3=(t3/100);
    			taux3=pc3+1;
    			h3=((reste3*taux3)-reste3);
    			honoraires=(h1+h2+h3);
    			document.getElementById('taux-1').value=t1;
    			document.getElementById('palier1').value=Math.round(h1*100)/100;
    			document.getElementById('taux-2').value=t2;
    			document.getElementById('palier2').value=Math.round(h2*100)/100;
    			document.getElementById('taux-3').value=t3;
    			document.getElementById('palier3').value=Math.round(h3*100)/100;
    			document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    		}
    	else if(versement>=p4)
    		{
    			reste3=montantacompte;
    			pc3=(t3/100);
    			taux3=pc3+1;
    			h3=((reste3*taux3)-reste3);
    			honoraires=(h3);
     
    			document.getElementById('taux-3').value=t3;
    			document.getElementById('palier3').value=Math.round(h3*100)/100;
    			document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    		}
    	}
    	if (type=="l")
    	{
    	pc1=(t1/100);
    	taux1=pc1+1;
    	honoraires=montantacompte*taux1;
    	document.getElementById('taux-1').value=t1;
    	document.getElementById('palier1').value=Math.round(h1*100)/100;
    	document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    	}
     }
     
     </script>
    <input type="text" name="montantacompte" id="montantacompte" onblur="hono();payment();imputed();repartition()"    />
     
     <script type="text/javascript">
     function getItems()
     {
     var items = new Array();
     var itemCount = document.getElementsByClassName("items");
     
     for(var i = 0; i < itemCount.length; i++)
     {
         items[i] = document.getElementById("p" + (i+1)).value;
     }
     
     return items;
     }
     
     function setItems(items,payAmt)
     {
       //document.getElementById("montantacompte").value = payAmt;
       for(var i = 0; i < items.length; i++)
       {
          document.getElementById("p" + (i+1)).value = Math.round(items[i]*100)/100;
       }
     }
     
     function itemSum(items)
     {
    var sum = 0;
     
    for(var i=0; i < items.length; i++)
    {
        sum = items[i] + sum;
    }
     
    return sum;
     }
     
     function payment(montantacompte)
     {
     var items = getItems();
     var payAmt = document.getElementById("montantacompte").value;
     var i = 0;
     var sum = itemSum(items);
     
     while(payAmt != 0 && sum != 0)
     {
         var temp = items[i] - payAmt;
         if(temp > 0)
         {
             items[i] = temp;
             break;
         }
         else if(temp < 0)
         {
             items[i] = 0;
             payAmt = temp*-1;
          }
         i++;
         sum = itemSum(items);
     }
     
      setItems(items, payAmt);
     }
     
    </script>
    <script type="text/javascript">
    function repartition()
    {
    	var principal_p 			= 0; 
    	var principal_c 			= 100; 
    	var interets_p 				= 50; 
    	var interets_c 				= 50; 
    	var clause_penale_p 		= 100; 
    	var clause_penale_c		 	= 0; 
    	var domages_interets_p 		= 0; 
    	var domages_interets_c	 	= 100; 
    	var art700_cpc_p	 		= 100; 
    	var art700_cpc_c 			= 0; 
    	var art475_1_cpp_p 			= 100; 
    	var art475_1_cpp_c 			= 0; 
    	var art_441_6_cc_p 			= 50; 
    	var art_441_6_cc_c 			= 50;
    	var frais_ar_p 				= 100; 
    	var frais_ar_c	 			= 0;
    	var agios_p 				= 0; 
    	var agios_c 				= 100;
    	var depens_p 				= 80; 
    	var depens_c 				= 20;	
    	var frais_execution_p		= 40; 
    	var frais_execution_c 		= 60;	
    	var contrib_aid_juridiq_p	= 100; 
    	var contrib_aid_juridiq_c 	= 0;	
    	var frais_greffe_p 			= 50; 
    	var frais_greffe_c 			= 50;	
    	principal = document.getElementById("r1").value;
    	interets  = document.getElementById("r2").value;
    	clause_penale= document.getElementById("r3").value;
    	domages_interets= document.getElementById("r4").value;
    	art700_cpc = document.getElementById("r5").value;
    	art475_1_cpp = document.getElementById("r6").value;
    	art_441_6_cc = document.getElementById("r7").value;
    	frais_ar = document.getElementById("r8").value;
    	agios = document.getElementById("r9").value;
    	depens = document.getElementById("r10").value;	
    	frais_execution = document.getElementById("r11").value;	
    	contrib_aid_juridiq = document.getElementById("r12").value;	
    	frais_greffe = document.getElementById("r13").value;	
    	document.getElementById("nprincipal").value= (principal*principal_p)/100;
    	document.getElementById("vprincipal").value= (principal*principal_c)/100;
    	document.getElementById("ninterets").value= (interets*interets_p)/100;
    	document.getElementById("vinterets").value= (interets*interets_c)/100;
    	document.getElementById("nclause_penale").value= (clause_penale*clause_penale_p)/100;
    	document.getElementById("vclause_penale").value= (clause_penale*clause_penale_c)/100;
    	document.getElementById("ndomages_interets").value= (domages_interets*domages_interets_p)/100;
    	document.getElementById("vdomages_interets").value= (domages_interets*domages_interets_c)/100;
    	document.getElementById("nart700_cpc").value= (art700_cpc*art700_cpc_p)/100;
    	document.getElementById("vart700_cpc").value= (art700_cpc*art700_cpc_c)/100;
    	document.getElementById("nart475_1_cpp").value= (art475_1_cpp*art475_1_cpp_p)/100;
    	document.getElementById("vart475_1_cpp").value= (art475_1_cpp*art475_1_cpp_c)/100;
    	document.getElementById("nart_441_6_cc").value= (art_441_6_cc*art_441_6_cc_p)/100;
    	document.getElementById("vart_441_6_cc").value= (art_441_6_cc*art_441_6_cc_c)/100;
    	document.getElementById("nfrais_ar").value= (frais_ar*frais_ar_p)/100;
    	document.getElementById("vfrais_ar").value= (frais_ar*frais_ar_c)/100;
    	document.getElementById("nagios").value= (agios*agios_p)/100;
    	document.getElementById("vagios").value= (agios*agios_c)/100;
    	document.getElementById("ndepens").value= (depens*depens_p)/100;
    	document.getElementById("vdepens").value= (depens*depens_c)/100;
    	document.getElementById("nfrais_execution").value= (frais_execution*frais_execution_p)/100;
    	document.getElementById("vfrais_execution").value= (frais_execution*frais_execution_c)/100;
    	document.getElementById("ncontrib_aid_juridiq").value= (contrib_aid_juridiq*contrib_aid_juridiq_p)/100;
    	document.getElementById("vcontrib_aid_juridiq").value= (contrib_aid_juridiq*contrib_aid_juridiq_c)/100;
    	document.getElementById("nfrais_greffe").value= (frais_greffe*frais_greffe_p)/100;
    	document.getElementById("vfrais_greffe").value= (frais_greffe*frais_greffe_c)/100;
    }</script>
            &euro;</p></td><td width="257" align="center"><p align="center"><input type="checkbox" name="pd" value="pd" /> Paiement Direct? </p></td>
     
          </tr>
     
     
    </table>

  4. #4
    Membre Expert

    Homme Profil pro
    Ingénieur Hospitalier
    Inscrit en
    Juillet 2004
    Messages
    993
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur Hospitalier
    Secteur : Santé

    Informations forums :
    Inscription : Juillet 2004
    Messages : 993
    Billets dans le blog
    1
    Par défaut
    Salut d'après ton code il semblerait que le champs dont id est taux-1 n'existe pas dans ton formulaire.
    Existe t-il? car il empêche l'exécution de ton script.
    Idem pour les champs dont l'id est "palier1" et "sommehonoraires"
    Après avoir rectifier ses champs, ton script remarchera.

    J'ai fait un test en créant ses inputs inexistants (en leur passant des valeurs en hidden).
    Le script s’exécute bien, sans erreur et remplit bien tout les champs.

    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
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
     
    <html>
    <head>
    <script type="text/javascript">
    function getItems()
    {
    var items = new Array();
    var itemCount = document.getElementsByClassName("items");
     
    for(var i = 0; i < itemCount.length; i++)
    {
        items[i] = document.getElementById("p" + (i+1)).value;
    }
     
    return items;
    }
     
    function setItems(items,payAmt)
    {
      //document.getElementById("montantacompte").value = payAmt;
      for(var i = 0; i < items.length; i++)
      {
         document.getElementById("p" + (i+1)).value = Math.round(items[i]*100)/100;
      }
    }
     
    function itemSum(items)
    {
    var sum = 0;
     
    for(var i=0; i < items.length; i++)
    {
       sum = items[i] + sum;
    }
     
    return sum;
    }
     
    function payment(montantacompte)
    {
    var items = getItems();
    var payAmt = document.getElementById("montantacompte").value;
    var i = 0;
    var sum = itemSum(items);
     
    while(payAmt != 0 && sum != 0)
    {
        var temp = items[i] - payAmt;
        if(temp > 0)
        {
            items[i] = temp;
            break;
        }
        else if(temp < 0)
        {
            items[i] = 0;
            payAmt = temp*-1;
         }
        i++;
        sum = itemSum(items);
    }
     
     setItems(items, payAmt);
    }
    function repartition()
    {
    	var principal_p 			= 0; 
    	var principal_c 			= 100; 
    	var interets_p 				= 50; 
    	var interets_c 				= 50; 
    	var clause_penale_p 		= 100; 
    	var clause_penale_c		 	= 0; 
    	var domages_interets_p 		= 0; 
    	var domages_interets_c	 	= 100; 
    	var art700_cpc_p	 		= 100; 
    	var art700_cpc_c 			= 0; 
    	var art475_1_cpp_p 			= 100; 
    	var art475_1_cpp_c 			= 0; 
    	var art_441_6_cc_p 			= 50; 
    	var art_441_6_cc_c 			= 50;
    	var frais_ar_p 				= 100; 
    	var frais_ar_c	 			= 0;
    	var agios_p 				= 0; 
    	var agios_c 				= 100;
    	var depens_p 				= 80; 
    	var depens_c 				= 20;	
    	var frais_execution_p		= 40; 
    	var frais_execution_c 		= 60;	
    	var contrib_aid_juridiq_p	= 100; 
    	var contrib_aid_juridiq_c 	= 0;	
    	var frais_greffe_p 			= 50; 
    	var frais_greffe_c 			= 50;	
    	principal = document.getElementById("r1").value;
    	interets  = document.getElementById("r2").value;
    	clause_penale= document.getElementById("r3").value;
    	domages_interets= document.getElementById("r4").value;
    	art700_cpc = document.getElementById("r5").value;
    	art475_1_cpp = document.getElementById("r6").value;
    	art_441_6_cc = document.getElementById("r7").value;
    	frais_ar = document.getElementById("r8").value;
    	agios = document.getElementById("r9").value;
    	depens = document.getElementById("r10").value;	
    	frais_execution = document.getElementById("r11").value;	
    	contrib_aid_juridiq = document.getElementById("r12").value;	
    	frais_greffe = document.getElementById("r13").value;	
    	document.getElementById("nprincipal").value= (principal*principal_p)/100;
    	document.getElementById("vprincipal").value= (principal*principal_c)/100;
    	document.getElementById("ninterets").value= (interets*interets_p)/100;
    	document.getElementById("vinterets").value= (interets*interets_c)/100;
    	document.getElementById("nclause_penale").value= (clause_penale*clause_penale_p)/100;
    	document.getElementById("vclause_penale").value= (clause_penale*clause_penale_c)/100;
    	document.getElementById("ndomages_interets").value= (domages_interets*domages_interets_p)/100;
    	document.getElementById("vdomages_interets").value= (domages_interets*domages_interets_c)/100;
    	document.getElementById("nart700_cpc").value= (art700_cpc*art700_cpc_p)/100;
    	document.getElementById("vart700_cpc").value= (art700_cpc*art700_cpc_c)/100;
    	document.getElementById("nart475_1_cpp").value= (art475_1_cpp*art475_1_cpp_p)/100;
    	document.getElementById("vart475_1_cpp").value= (art475_1_cpp*art475_1_cpp_c)/100;
    	document.getElementById("nart_441_6_cc").value= (art_441_6_cc*art_441_6_cc_p)/100;
    	document.getElementById("vart_441_6_cc").value= (art_441_6_cc*art_441_6_cc_c)/100;
    	document.getElementById("nfrais_ar").value= (frais_ar*frais_ar_p)/100;
    	document.getElementById("vfrais_ar").value= (frais_ar*frais_ar_c)/100;
    	document.getElementById("nagios").value= (agios*agios_p)/100;
    	document.getElementById("vagios").value= (agios*agios_c)/100;
    	document.getElementById("ndepens").value= (depens*depens_p)/100;
    	document.getElementById("vdepens").value= (depens*depens_c)/100;
    	document.getElementById("nfrais_execution").value= (frais_execution*frais_execution_p)/100;
    	document.getElementById("vfrais_execution").value= (frais_execution*frais_execution_c)/100;
    	document.getElementById("ncontrib_aid_juridiq").value= (contrib_aid_juridiq*contrib_aid_juridiq_p)/100;
    	document.getElementById("vcontrib_aid_juridiq").value= (contrib_aid_juridiq*contrib_aid_juridiq_c)/100;
    	document.getElementById("nfrais_greffe").value= (frais_greffe*frais_greffe_p)/100;
    	document.getElementById("vfrais_greffe").value= (frais_greffe*frais_greffe_c)/100;
    }
     
    function imputed()
    {
    var a1= document.getElementById("a1").value;
    var a2= document.getElementById("a2").value;
    var a3= document.getElementById("a3").value;
    var a4= document.getElementById("a4").value;
    var a5= document.getElementById("a5").value;
    var a6= document.getElementById("a6").value;
    var a7= document.getElementById("a7").value;
    var a8= document.getElementById("a8").value;
    var a9= document.getElementById("a9").value;
    var a10= document.getElementById("a10").value;
    var a11= document.getElementById("a11").value;
    var a12= document.getElementById("a12").value;
    var a13= document.getElementById("a13").value;
    var p1= document.getElementById("p1").value;
    var p2= document.getElementById("p2").value;
    var p3= document.getElementById("p3").value;
    var p4= document.getElementById("p4").value;
    var p5= document.getElementById("p5").value;
    var p6= document.getElementById("p6").value;
    var p7= document.getElementById("p7").value;
    var p8= document.getElementById("p8").value;
    var p9= document.getElementById("p9").value;
    var p10= document.getElementById("p10").value;
    var p11= document.getElementById("p11").value;
    var p12= document.getElementById("p12").value;
    var p13= document.getElementById("p13").value;
     
    document.getElementById('r1').value=Math.round((a1-p1)*100)/100;
    document.getElementById('r2').value=Math.round((a2-p2)*100)/100;
    document.getElementById('r3').value=Math.round((a3-p3)*100)/100;
    document.getElementById('r4').value=Math.round((a4-p4)*100)/100;
    document.getElementById('r5').value=Math.round((a5-p5)*100)/100;
    document.getElementById('r6').value=Math.round((a6-p6)*100)/100;
    document.getElementById('r7').value=Math.round((a7-p7)*100)/100;
    document.getElementById('r8').value=Math.round((a8-p8)*100)/100;
    document.getElementById('r9').value=Math.round((a9-p9)*100)/100;
    document.getElementById('r10').value=Math.round((a10-p10)*100)/100;
    document.getElementById('r11').value=Math.round((a11-p11)*100)/100;
    document.getElementById('r12').value=Math.round((a12-p12)*100)/100;
    document.getElementById('r13').value=Math.round((a13-p13)*100)/100;	
    }
     function hono(p1,p2,p3,p4,t1,t2,t3,type,versement,montantacompte)
     {
    	 var p1		 		= 5000.00;
     	 var p2		 		= 5000.01;
     	 var p3 			= 8000.00;
    	 var p4 			= 8000.01;
    	 var t1			 	= 17.00;
    	 var t2 			= 10.00;
    	 var t3 			= 6.00;
    	 var type			= "d";
     	 var versement  	= 0;
    	 var montantacompte	= document.getElementById("montantacompte").value;
     
     
    	 if (type== "d")
    	 	{
    			if(versement== 0.00 && montantacompte <= p1)
    			{
    				reste1= montantacompte;
    				pc= t1/100;
    				taux1= pc+1;
    				h1=((reste1*taux1)-reste1);
    				honoraires=h1;
    				document.getElementById('taux-1').value=t1;
    				document.getElementById('palier1').value=Math.round(h1*100)/100;
    				document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    			}
    			else if(versement < p1 && (versement + montantacompte) <= p1)
    			{
    				reste1= montantacompte;
    				pc= t1/100;
    				taux1= pc+1;
    				h1= (reste1*taux1)-reste1;
    				honoraires= h1;
    				document.getElementById('taux-1').value=t1;
    				document.getElementById('palier1').value=Math.round(h1*100)/100;
    				document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    			}
    			else if(versement <= p1 && (versement+montantacompte)>= p2 && (versement+montantacompte)<=p3)
    			{
    				reste1=p1-versement;
    				pc=t1/100;
    				taux1=pc+1;
    				h1=(reste1*taux1)-reste1;
    				reste2=montantacompte-reste1;
    				pc2=t2/100;
    				taux2=pc2+1;
    				h2=(reste2*taux2)-reste2;
    				honoraires=h1+h2;
    				document.getElementById('taux-1').value=t1;
    				document.getElementById('palier1').value=Math.round(h1*100)/100;
    				document.getElementById('taux-2').value=t2;
    				document.getElementById('palier2').value=Math.round(h2*100)/100;
    				document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    			}
    			else if (versement==0.00 && montantacompte>=p2 && montantacompte <=p3)
    			{
    				reste2=montantacompte-p1;
    				reste1=p1;
    				pc=(t1/100);
    				taux1=pc+1;
    				h1=((reste1*taux1)-reste1);
    				pc2=(t2/100);
    				taux2=pc2+1;
    				h2=((reste2*taux2)-reste2);
    				honoraires=(h1+h2);
    				document.getElementById('taux-1').value=t1;
    				document.getElementById('palier1').value=Math.round(h1*100)/100;
    				document.getElementById('taux-2').value=t2;
    				document.getElementById('palier2').value=Math.round(h2*100)/100;
    				document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    			}
    			else if(versement<=p3 && versement>=p2 && (versement+montantacompte)>=p2 && (versement+montantacompte)<=p3)
    			{
    			reste1=montantacompte;
    			pc=(t2/100);
    			taux1=pc+1;
    			h1=((reste1*taux1)-reste1);
    			honoraires=h1;	
    			document.getElementById('taux-1').value=t1;
    			document.getElementById('palier1').value=Math.round(h1*100)/100;
    			document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    			}
    			else if(versement>=p2 && versement<=p3 && (versement+montantacompte)>=p4)
    			{
    			reste1=p4-versement;
    			pc=(t2/100);
    			taux2=pc+1;
    			h2=((reste1*taux2)-reste1);
    			reste2=montantacompte-reste1;
    			pc2=(t3/100);
    			taux3=pc2+1;
    			h3=((reste2*taux3)-reste2);
    			honoraires=(h2+h3);
    			document.getElementById('taux-3').value=t3;
    			document.getElementById('palier3').value=Math.round(h3*100)/100;
    			document.getElementById('taux-2').value=t2;
    			document.getElementById('palier2').value=Math.round(h2*100)/100;
    			document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    		}
    		else if(versement==0.00 && montantacompte>=p4)
    		{
    			reste1=p1;
    			reste2=p3-p2;
    			pc=(t1/100);
    			taux1=pc+1;
    			h1=((reste1*taux1)-reste1);
    			pc2=(t2/100);
    			taux2=pc2+1;
    			h2=((reste2*taux2)-reste2);
    			reste3=(montantacompte-reste1-reste2);
    			pc3=(t3/100);
    			taux3=pc3+1;
    			h3=((reste3*taux3)-reste3);
    			honoraires=(h1+h2+h3);
    			document.getElementById('taux-1').value=t1;
    			document.getElementById('palier1').value=Math.round(h1*100)/100;
    			document.getElementById('taux-2').value=t2;
    			document.getElementById('palier2').value=Math.round(h2*100)/100;
    			document.getElementById('taux-3').value=t3;
    			document.getElementById('palier3').value=Math.round(h3*100)/100;
    			document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    		}
    	else if(versement>=p4)
    		{
    			reste3=montantacompte;
    			pc3=(t3/100);
    			taux3=pc3+1;
    			h3=((reste3*taux3)-reste3);
    			honoraires=(h3);
     
    			document.getElementById('taux-3').value=t3;
    			document.getElementById('palier3').value=Math.round(h3*100)/100;
    			document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    		}
    	}
    	if (type=="l")
    	{
    	pc1=(t1/100);
    	taux1=pc1+1;
    	honoraires=montantacompte*taux1;
    	document.getElementById('taux-1').value=t1;
    	document.getElementById('palier1').value=Math.round(h1*100)/100;
    	document.getElementById('sommehonoraires').value=Math.round(honoraires*100)/100;
    	}
     }
     
    </script>
    </head>
    <body>
     
    <form action="#" method="post">
    <fieldset  style="background:#FFF" ><legend><strong>Versement</strong>:</legend>
    <input type="hidden" name="n_doss" value="120015660012" />
    <input type="hidden" name="etat" value="3" />
     
    <strong>Dossier:</strong> 120015660012  - <strong>Affaire:</strong> S.A.S. PRO<strong> c/</strong> AC L'art de Construire
    <table width="79%" height="347" class="month" style="width:100%; height:150px" >
    <tr><td width="7%" bgcolor="#99CCCC" ><p align="center"><strong>ORDRE</strong></p></td><td width="13%" bgcolor="#99CCCC" ><p align="center"><strong>LIBELLE</strong></p></td><td width="10%" bgcolor="#99CCCC" ><p align="center"><strong>MONTANT INITIAL</strong></p></td><td width="10%" bgcolor="#99CCCC" ><p align="center"><strong>MONTANT IMPUT&Eacute;</strong></p></td><td width="10%" bgcolor="#99CCCC" ><p align="center"><strong>MONTANT RESTANT</strong></p></td><td width="10%" bgcolor="#99CCCC" ><p align="center"><strong>PRO</strong></p></td><td width="10%" bgcolor="#99CCCC" ><p align="center"><strong>CLIENT</strong></p></td></tr>
    <tr>
    	<td bgcolor="#FAFAFA">	  	  <input name="ordre_principal" type="text" id="ordre_principal" value="1" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">PRINCIPAL</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="principal" type="hidden" id="m1" value="16058.82" readonly="readonly"  /><input name="a1" type="text" id="a1" value="16058.82" size="10" />
     </td>
             <td bgcolor="#FAFAFA"><input  type="text" id="r1" size="10"   /></td>
        <td bgcolor="#FAFAFA"><input type="text" name="principal_s" id="p1" value="0.00" class="items" size="10"   /></td>
       <td bgcolor="#FAFAFA"> <input type="text" id="nprincipal" name="nprincipal" size="10" /></td>
       <td bgcolor="#FAFAFA"> <input type="text" id="vprincipal" name="vprincipal"  size="10" /></td>
    </tr>
    <tr>
    <td bgcolor="#FAFAFA"><input name="ordre_interets" type="text" id="ordre_interets" value="2" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">INT&Eacute;R&Ecirc;TS</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="interets" type="hidden" id="m2" value="2.49" readonly="readonly"  /><input name="interets" type="text" id="a2" value="2.49" size="10" readonly="readonly"  />
        </td>
         <td bgcolor="#FAFAFA"><input type="text" id="r2" size="10" />
        </td>
        <td bgcolor="#FAFAFA"><input name="interets_s" type="text" class="items" id="p2" value="0.00" size="10" />
        </td>
          <td bgcolor="#FAFAFA"><input name="ninterets" type="text"  id="ninterets" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vinterets" type="text"  id="vinterets" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_clause_penale" type="text" id="ordre_clause_penale" value="3" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">CLAUSE P&Eacute;NALE</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="clause_penale" type="text" id="a3" value="400.00" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r3" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="clause_penale_s" type="text" class="items" id="p3" value="0.00" size="10"  />
        </td>
         <td bgcolor="#FAFAFA"><input name="nclause_penale" type="text"  id="nclause_penale" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vclause_penale" type="text"  id="vclause_penale" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_domages_interets2" type="text" id="ordre_domages_interets" value="4" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">DOMMAGES ET INT&Eacute;R&Ecirc;TS</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="domages_interets" type="text" id="a4" value="400.00" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r4" size="10" />
        </td>
          <td bgcolor="#FAFAFA"><input name="domages_interets_s" type="text" class="items" id="p4" value="0.00" size="10" />
        </td>
         <td bgcolor="#FAFAFA"><input name="ndomages_interets_s" type="text"  id="ndomages_interets" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vdomages_interets_s" type="text"  id="vdomages_interets" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_art700_cpc" type="text" id="ordre_art700_cpc" value="5" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">ART 700 DU CPC</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="art700_cpc" type="text" id="a5" value="150.00" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r5" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="art700_cpc_s" type="text" class="items" id="p5" value="0.00" size="10"  />
        </td>
           <td bgcolor="#FAFAFA"><input name="nart700_cpc" type="text"  id="nart700_cpc" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vart700_cpc" type="text"  id="vart700_cpc" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_art475_1_cpp" type="text" id="ordre_art475_1_cpp" value="6" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">ART 475-1 DU CPP</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="art475_1_cpp" type="text" id="a6" value="75.00" size="10" readonly="readonly"  />
        </td>
         <td bgcolor="#FAFAFA"><input type="text" id="r6" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="art475_1_cpp_s" type="text" class="items" id="p6" value="0.00" size="10"  />
        </td>
           <td bgcolor="#FAFAFA"><input name="nart475_1_cpp" type="text"  id="nart475_1_cpp" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vart475_1_cpp" type="text"  id="vart475_1_cpp" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_art_441_6_cc" type="text" id="ordre_art_441_6_cc" value="7" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">ART 441-6 DU CC</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="art_441_6_cc" type="text" id="a7" value="85.25" size="10" readonly="readonly"  />
        </td>
         <td bgcolor="#FAFAFA"><input type="text" id="r7" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="art_441_6_cc_s" type="text" class="items" id="p7" value="0.00" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="nart_441_6_cc" type="text"  id="nart_441_6_cc" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vart_441_6_cc" type="text"  id="vart_441_6_cc" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_frais_ar" type="text" id="ordre_frais_ar" value="8" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">FRAIS D'AR</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="frais_ar" type="text" id="a8" value="4.33" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r8" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="frais_ar_s" type="text" class="items" id="p8" value="0.00" size="10"  />
        </td>
         <td bgcolor="#FAFAFA"><input name="nfrais_ar" type="text"  id="nfrais_ar" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vfrais_ar" type="text"  id="vfrais_ar" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_agios" type="text" id="ordre_agios" value="9" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">FRAIS ET AGIOS</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="agios" type="text" id="a9" value="257.00" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r9" size="10" />
        </td>
         <td bgcolor="#FAFAFA"><input name="agios_s" type="text" class="items" id="p9" value="0.00" size="10" />
        </td>
          <td bgcolor="#FAFAFA"><input name="nagios" type="text"  id="nagios" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vagios" type="text"  id="vagios" size="10" /></td>
    </tr>
    <tr><td width="3" bgcolor="#FAFAFA"><input name="ordre_depens" type="text" id="ordre_depens" value="10" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">DEPENS</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="depens" type="text" id="a10" value="362.38" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r10" size="10"  />
        </td>
         <td bgcolor="#FAFAFA"><input name="depens_s" type="text" class="items" id="p10" value="0.00" size="10"  />
        </td>
              <td bgcolor="#FAFAFA"><input name="ndepens" type="text"  id="ndepens" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vdepens" type="text"  id="vdepens" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_frais_execution" type="text" id="ordre_frais_execution" value="11" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">FRAIS D'EX&Eacute;XUTION</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="frais_execution" type="text" id="a11" value="968.11" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r11" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="frais_execution_s" type="text" class="items" id="p11" value="0.00" size="10"  />
        </td>
        <td bgcolor="#FAFAFA"><input name="nfrais_execution" type="text"  id="nfrais_execution" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vfrais_execution" type="text"  id="vfrais_execution" size="10" /></td>
    </tr>
    <tr><td bgcolor="#FAFAFA"><input name="ordre_contrib_aid_juridiq" type="text" id="ordre_contrib_aid_juridiq" value="12" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">CONTRIBUTION A L'AIDE JURIDIQUE</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="contrib_aid_juridiq" type="text" id="a12" value="149.12" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r12" size="10" />
        </td>
          <td bgcolor="#FAFAFA"><input name="contrib_aid_juridiq_s" type="text" class="items" id="p12" value="0.00" size="10" />
        </td>
        <td bgcolor="#FAFAFA"><input name="ncontrib_aid_juridiq" type="text"  id="ncontrib_aid_juridiq" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vcontrib_aid_juridiq" type="text"  id="vcontrib_aid_juridiq" size="10" /></td>
    </tr>
    <tr><td width="3" bgcolor="#FAFAFA"><input name="ordre_frais_greffe" type="text" id="ordre_frais_greffe" value="13" size="3" readonly="readonly"  /></td>
    	<td bgcolor="#FAFAFA"><p align="center">FRAIS DE GREFFE</p>
        </td>
        <td bgcolor="#FAFAFA"><input name="frais_greffe" type="text" id="a13" value="4.33" size="10" readonly="readonly"  />
        </td>
        <td bgcolor="#FAFAFA"><input type="text" id="r13" size="10"  />
        </td>
         <td bgcolor="#FAFAFA"><input name="frais_greffe_s" type="text" class="items" id="p13" value="0.00" size="10"  />
        </td>
         <td bgcolor="#FAFAFA"><input name="nfrais_greffe" type="text"  id="nfrais_greffe" size="10" /></td>
          <td bgcolor="#FAFAFA"><input name="vfrais_greffe" type="text"  id="vfrais_greffe" size="10" /></td>
    </tr>
     
    </table><hr>
      <table width="100%" class="contacts">
      <tr>
        <td width="38" class="contactDept"><p align="center"><strong>DATE</strong></p></td><td width="215" class="contactDept"><p align="center"><strong>MODE</strong></p></td><td width="232" class="contactDept"><p align="center"><strong>MONTANT</strong></p></td><td width="257" class="contactDept"><p align="center"><strong>PAIEMENT</strong></p></td></tr>
          <tr>
            <td align="center"><p align="center"><input name="date_reception" type="text" id="date_reception" value="" size="5"  /></p></td><td align="center"><p align="center"><select name="mode"><option value="CHEQUE DEBITEUR">CHEQUE DEBITEUR</option><option value="CHEQUE CARPA">CHEQUE CARPA</option><option value="VIREMENT">VIREMENT</option><option value="MANDAT CASH">MANDAT CASH</option><option value="MANDAT COMPTE">MANDAT COMPTE</option><option value="MANDAT ADMINISTRATIF">MANDAT ADMINISTRATIF</option><option value="CB A AGENT">CARTE BLEUE AVEC UN AGENT</option><option value="CB SUR SITE">CARTE BLEUE SUR LE SITE</option> </select></p></td><td><p align="center">   
    <input type="text" name="montantacompte" id="montantacompte" onblur="hono();payment();imputed();repartition()"    />
     
            &euro;</p></td><td width="257" align="center"><p align="center"><input type="checkbox" name="pd" value="pd" /> Paiement Direct? </p></td>
     			<input id="taux-1" type="hidden" value="10"/>
     			<input id="palier1" type="hidden" value="10"/>
     			<input id="sommehonoraires" type="hidden" value="2"/>
          </tr>
    </table>
    </fieldset>
    </form>
    </body>
    </html>

  5. #5
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2007
    Messages
    197
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Conseil

    Informations forums :
    Inscription : Avril 2007
    Messages : 197
    Par défaut
    il existe ici
    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
    <table width="100%" class="contacts">
      <tr>
        <td class="contactDept"><p align="center"><strong>Palier  1</strong></p></td><td class="contactDept"><p align="center"><strong>Taux 1</strong></p></td><td class="contactDept"><p align="center"><strong>Palier 2 </strong></p></td>
        <td class="contactDept"><p align="center"><strong>Taux 2</strong></p></td>
        <td class="contactDept"><p align="center"><strong>Palier 3</strong></p></td>
        <td class="contactDept"><p align="center"><strong>Taux 3</strong></p></td>
        <td class="contactDept"><p align="center"><strong>&sum; Honoraires</strong></p></td></tr>
     
          <tr>
            <td align="center"><p align="center">
            <input name="palier1" id="palier1" type="text" size="8" readonly="readonly"  /> &euro;</p></td><td align="center"><p align="center">
            <input name="taux-1" id="taux-1" type="text" size="8" readonly="readonly" /> %</p></td><td><p align="center">
            <input name="palier2" id="palier2" type="text" size="8" readonly="readonly" />
    &euro;</p></td>
            <td  align="center"><p align="center"> <input name="taux-2" id="taux-2" type="text" size="8" readonly="readonly" /> %
            </p></td>
            <td  align="center"><p align="center"> <input name="palier3" id="palier3" type="text" size="8" readonly="readonly" /> &euro;
            </p></td>
            <td  align="center"><p align="center">  <input name="taux-3" id="taux-3" type="text" size="8" readonly="readonly" /> %
     
    </p></td>
            <td  align="center"><p align="center"> <input name="sommehonoraires" id="sommehonoraires" type="text" size="8" readonly="readonly" /> &euro;</p></td>
     
          </tr>
     
     
    </table>
    en fait c'est une autre fonction.

  6. #6
    Membre Expert

    Homme Profil pro
    Ingénieur Hospitalier
    Inscrit en
    Juillet 2004
    Messages
    993
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur Hospitalier
    Secteur : Santé

    Informations forums :
    Inscription : Juillet 2004
    Messages : 993
    Billets dans le blog
    1
    Par défaut
    Question tout le code html est bien dans la même page, car d'après ton script si ces éléments n'existent pas, il ne s’exécutera pas, car les paramètres de ces champs sont contraints dans ton code.

Discussions similaires

  1. Inverse de la fonction de répartition gaussienne
    Par 20100. dans le forum Calcul scientifique
    Réponses: 2
    Dernier message: 24/01/2011, 10h57
  2. Fonction de répartition loi normale
    Par lilmeth dans le forum Langage
    Réponses: 1
    Dernier message: 29/12/2010, 22h44
  3. Répartition d'un montant au prorata
    Par TheRealMike dans le forum SAS Base
    Réponses: 1
    Dernier message: 07/05/2009, 13h40
  4. Réponses: 6
    Dernier message: 08/09/2008, 14h47
  5. fonction de répartition d'une transformation
    Par NELLLY dans le forum Probabilités
    Réponses: 10
    Dernier message: 12/03/2008, 00h36

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