Skip to main content
Participant
October 18, 2021
Question

Form Calculation Question

  • October 18, 2021
  • 1 reply
  • 350 views

I've created a fillable form using Acrobat Pro DC. Section 2 in my form is the result of the following calculation: Text Field 7 multipled by Test Field 9. Is there a way I can make Section 2 of my form display the value of  TF 7 only if TF 9 is zero? Right now when TF 9 has no value, Section 2 is showing zero instead of what I have in TF 7. I hope this makes sense. I'm stumped by this one. 

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
October 18, 2021

You can try like this:

var a = Number(this.getField("Test Field 7").valueAsString);
var b = Number(this.getField("Test Field 9").valueAsString);
if(b == 0) event.value = a;
else event.value = a*b;