abracadabraPDF › Forums › PDF – Général › Problème dans le calcul de soustraction. – RÉPONDU › Répondre à : Problème dans le calcul de soustraction. – RÉPONDU
11 juin 2013 à 18:04
#55121
Maître des clés
Salut,
Il y a 2 façons de faire : protéger le script avant le calcul ou après.
J’ai choisi la 2e possibilité.
Tu as mis :
a = this.getField(« total3.2 »).value;
b = this.getField(« total2.2 »).value;
totalglobal = a-b;
event.target.value = totalglobal;
Que l’on peut protéger ainsi :
a = this.getField(« total3.2 »).value;
b = this.getField(« total2.2 »).value;
totalglobal = a-b;
if (totalglobal > « 0 »)
{event.target.value = totalglobal;}
else
{event.target.value = « »;}
:Smiley03:
