Copy link to clipboard
Copied
Hello all
I am need to using Acrobat for calculations and I am look for some help with an if statement this is what I am trying to do
I have an input box and I need to take what ever is put into that box and calculate and show that in the secound box, but I need it to not show anything in the second box if nothing is put in the first box. I hope this makes sense, this is the jave script I have and the calculation works but it will still do a calculation in no number is in the first box
these are the 2 boxes
in the calculation I have this script
event.value=((-(+this.getField("Input").value/3-6000)*(1.052-0.7778)/100))
Any help would be great and thanks in advance
Change your code to this:
var v = this.getField("Input").valueAsString;
if (v=="") event.value = "";
else event.value=((-(Number(v)/3-6000)*(1.052-0.7778)/100));
Copy link to clipboard
Copied
Change your code to this:
var v = this.getField("Input").valueAsString;
if (v=="") event.value = "";
else event.value=((-(Number(v)/3-6000)*(1.052-0.7778)/100));