bonjour a tous ,
je tente de faire un calcul via une fonction et une formule en js mais pour le moment j obtient une réponse NaN, il y a d autre formules pour le moment en commentaire qu il faudra que je traite par la suite
voici ma fonction:
du coté html :
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 function Calcul(){ var Pds_tot = Number(document.getElementById("Pds_tot").value); var Poids = Number(document.getElementById("Poids").value); var Qte_bloc = Number(document.getElementById("Qte_bloc").value); var Qte_Voie = Number(document.getElementById("Qte_Voie").value); var Dissip_recharge = Number(document.getElementById("Dissip_recharge").value); var Rinterne = Number(document.getElementById("Rinterne").value); var Icmax = Number(document.getElementById("Icmax").value); var coefpeB = Number(document.getElementById("coefpeB").value); var Nb_elem2V = Number(document.getElementById("Nb_elem2V").value); var Ah = Number(document.getElementById("Ah").value); var m3_h1 = Number(document.getElementById("m3_h1").value); var m3_h2 = Number(document.getElementById("m3_h2").value); var ICPE = Number(document.getElementById("ICPE").value); var Vbloc = Number(document.getElementById("Vbloc").value); var Dissip_float = Number(document.getElementById("Dissip_float").value); var Vfloat = Number(document.getElementById("Vfloat").value); var Iflaot = Number(document.getElementById("Iflaot").value); var m3_h1B = Number(coefpeB*8*0.001*100*Nb_elem2V*Qte_Voie*Qte_bloc*Ah/100); document.getElementById("m3_h1R").value = m3_h1B; /*var Pds_tot = Number(Poids*Qte_bloc*Qte_Voie); document.getElementById("Pds_tot").value = Poids_tot; var Dissip_recharge = Number((Rinterne*Qte_bloc*Qte_Voie*Icmax*Icmax/1000*100)/100); document.getElementById("Dissip_recharge").value = Dissip_recharge; var m3_h2 = Number(coefpe*Qte_Voie*Nb_elem2V*Qte_bloc*Ah*0.1*100/100); document.getElementById("m3_h2").value = m3_h2; var ICPE = Number(Icmax*Vbloc*Qte_bloc*Qte_Voie/100); document.getElementById("ICPE").value = ICPE; var Dissip_float = Number(Vfloat*Qte_Voie*Iflaot*100/100); document.getElementById("Dissip_float").value = Dissip_float;*/ }
je ne connais pas trop js et j essai de faire en fonction des renseignements trouvés sur le net, quelqu un pourrait il m aider ? un grand merci d avance
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 <table class="contenu" id="Caractèristique" width="600"> <tr> <td class="titreG">Calcul</td> <td class="titreC"></td> <td class="titreC"> </td> <td class="titreD"> </td> </tr> <tr > <td style="width:80px;">coef2: </td> <td><p style="color:white;"><input name="" id="coef2" value="[var.coef2;noerr]" type="text" style="width: 50px;" /></p></td> <td>coef2: </td> <td> </td> </tr> <tr> <td class="alignG">coef3: </td> <td class="alignG"><p style="color:white;"><input name="" id="coef3" value="[var.coef3;noerr]" type="text" style="width: 50px;" /></td> <td width="160" class="alignD">m3/h 1 Nouveau: </td> <td><input type="text" SIZE="10" STYLE="text-decoration:none;color: #FF0000;" name="m3_h1R" id="m3_h1R"></td> </tr> <tr> <td class="alignG">Qte_bloc : </td> <td class="alignG"><p style="color:white;"><input name="" id="Qte_bloc" value="[var.Qte_bloc;noerr]" type="text" style="width: 50px;" /></td> <td>Qte_bloc </td> <td> </td> </tr> <tr> <td class="alignG">Qte_Voie : </td> <td class="alignG"><p style="color:white;"><input name="" id="Qte_Voie" value="[var.Qte_Voie;noerr]" type="text" style="width: 50px;" /></td> <td>Qte_Voie : </td> <td> </td> </tr> <tr> <td class="alignG">coefpe : </td> <td class="alignG"><p style="color:white;"><input name="" id="coefpeB" value="[var.coefpe;noerr]" type="text" style="width: 50px;" /></td> <td>coefpe : </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td class="alignD"><input style="margin-bottom:5px;" id="Calcul" onClick="Calcul();" type="submit" value="Calcul"/></td> </tr> </table>
Partager