Copy link to clipboard
Copied
Looking for some assistance for a script that runs the calculations below based on the fields but also leaves the final field blank if nothing is in the other fields.
E12*E13*(E14/100)/2000
For example:
25*12.2*(27.5/100)/2000=0.0419
Any assistance is greatly appreciated.
DH
It's fixed! Thanks for catching that, don't know how I missed it. Much appreciated!
Copy link to clipboard
Copied
Use this code as the custom calculation script of the field where you want to show the result:
var v1 = this.getField("E12").valueAsString;
var v2 = this.getField("E13").valueAsString;
var v3 = this.getField("E14").valueAsString;
if (v1=="" || v2=="" || v3=="") event.value = "";
else event.value = Number(v1)*Number(v2)*((Number(v3)/100)/2000);
Copy link to clipboard
Copied
Thank you for your quick response! What would be the script for this one?
B10*C10*(D10/100)*(E10/100)/2000
76*9.42*(14.5/100)*(33/100)/2000=0.0171
Copy link to clipboard
Copied
Just follow the same logic I provided above...
You should also read this tutorial: https://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations
Copy link to clipboard
Copied
Thanks for your help on the script and reference materials. Any idea what is causing the output box (0.0348) to produce a shadow behind it?
var v1 = this.getField("J10").valueAsString;
var v2 = this.getField("K10").valueAsString;
var v3 = this.getField("L10").valueAsString;
var v4 = this.getField("M10").valueAsString;
if (v1=="" || v2=="" || v3=="" || v4=="") event.value = "";
else event.value = Number(v1)*Number(v2)*((Number(v3)/100)*((100-Number(v4))/100)/2000);
Copy link to clipboard
Copied
Maybe you've set the field to have a visible border line... Check under the field's Properties - Appearance.
Copy link to clipboard
Copied
I have it set to no border is selected.
Copy link to clipboard
Copied
Can you share the file with us (via Dropbox, Google Drive, Adobe Cloud, etc.)?
Copy link to clipboard
Copied
https://1drv.ms/b/s!ArGxeXz2349JhpINdIU3WpkevpElwg
Sorry for the delay, here's the link to the form. The issue is for Question # 10 fields beyond the example, you will see some of the fields that show 0.0348. Your assistance is greatly appreciated!
Copy link to clipboard
Copied
It appears fine to me... This is what I see:
The issue with the fields in the last column is that you have multiple fields one on top of each other in rows 3-8.
Copy link to clipboard
Copied
It's fixed! Thanks for catching that, don't know how I missed it. Much appreciated!