Copy link to clipboard
Copied
Hello
I have an interactive pdf form where my simple calculation doesnt get the correct answer - sometimes no answer at all?
A= number input by user
B= number input by user
V= A*B
so far so good, then:
C= number input by user
D= 0.8 1.2 3.5 (drop down list)
0.8 generates export value 0.7
1.2 generates export value 1.0
3.5 generates export value 2.3
Q= product of C and respective exported value ------ this value is sometimes 0?
T=V/Q*60 -----this is the final value which I never seem to get right
Copy link to clipboard
Copied
Did you check the field calculation order?
Copy link to clipboard
Copied
If Q is zero then you can't calculate a value for T, as division by zero is not allowed.
You must therefore use a script for T's calculation event, checking first if Q is zero. If so, apply an empty value to it.
If not, proceed with the calculation.
Copy link to clipboard
Copied
I understand that but Q should never be zero. Q must equal product of C and respective exported value - but sometimes the product is not calculated.
Now when I filled it in again I got Q but not T...
Copy link to clipboard
Copied
This is the calculation for T:
var volume = this.getField("V")
var flow = this.getField("Q")
if (flow.value==0) event.value = "";
else event.value = ( volume.value / flow.value ) * 60
Copy link to clipboard
Copied
Did you check the field calculation order?
Copy link to clipboard
Copied
Field order is: A, B, V, C, D, Q and T
Copy link to clipboard
Copied
Field calculation order helped - the solution was that simple!
Copy link to clipboard
Copied
Now I got value for T ...Is this a bug?
Also,
If I keep D the same (in this case D=1.2 which generates 1.0) and only change C.
I get different values for T...
then I try C= 6 again:
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more