Copy link to clipboard
Copied
I'm using Adobe Acrobat Pro,
Build: 23.3.20284.0
Experts, I'm struggling with the following script. In a PDF form, I'm trying to return the correct value to athe current field, baseHMONetTotal. The below does not return the value of i or t, it only returns the default value of 0.
// Get the values of the sumBaseHMOValue and baseHMOMOOP1 fields
var i = this.getField("sumBaseHMOValue").value;
var t = this.getField("baseHMOMOOP1").value;
var result = this.getField("bHMONetTotal").value;
// Compare i with t values
if (i > t) {
result.value = t; }
else if (i < t) {
result.value = i; }
Copy link to clipboard
Copied
Change:
var result = this.getField("bHMONetTotal").value;
To:
var result = this.getField("bHMONetTotal");
Copy link to clipboard
Copied
Thank you. I was not able to get this to work. However, I was able to get it to work another way. The problem had to do with a format problem several layers back in the form.