Copy link to clipboard
Copied
I am trying to do an IF THEN Calculation in PDF Form. This is beyond my expertise with PDF. There are 3 fields. A1, B1, C1. If A1 is greater than B1, then calculate A1-B1 =C1. If A1 is less than B1 then C1 would equals 0. For example.
A1 =24
B1 =20
C1=4
or
A1=19
B1 =20
C1= 0
Can anyone help with this?
Thank you
Use this:
var a1 = Number(this.getField("A1").valueAsString);
var b1 = Number(this.getField("B1").valueAsString);
if (a1>b1) event.value = a1-b1;
else event.value = 0;
Copy link to clipboard
Copied
Use this:
var a1 = Number(this.getField("A1").valueAsString);
var b1 = Number(this.getField("B1").valueAsString);
if (a1>b1) event.value = a1-b1;
else event.value = 0;