Can you help me to insert a JAVA script into an Adobe PDF form I created.

I have never programmed in Java and need a Java script to insert in a calculation field in an Adobe PDF form that I created using Adobe Acrobat Pro DC.  This form will be the one that can be filled on the PC or printed and filled out manually.  The calculated field will display a zero unwanted when printing and I want it to be empty.  Another field will be a calculated percentage and displays an error when there is no divider; a similar problem, I want to be a Virgin and the person filing the form manually to calculate the field and write.  I don't have time to learn

The Excel formula would be: If (Cell_1A = "", "", Cell_1A + Cell_1B)

What would be the JAVA script in a dialog box "Simplified field Notation" or "custom calculation Script?

Both of these things require a custom calculation. For the script of the division, you can use something like this:

var a = Number(this.getField("Field A").value);
var b = Number(this.getField("Field B").value);
if (b==0) event.value = "";
else event.value = a/b;

For the conditional script, you can use this:

var a = this.getField("Cell_1A").valueAsString;
var b = this.getField("Cell_1B").valueAsString;
if (a=="") event.value = "";
else event.value = Number(a)+Number(b);

Tags: Acrobat

Similar Questions

Maybe you are looking for