Copy link to clipboard
Copied
In Acrobat Pro 9, Field I, Properties, Actions tab, execute on Mouse up, entered the following javaScript:
if (H<3000){
I=3000
} else { I=H}
Field H is a calculated value.
I don't get any syntax errors, but when data is entered into the PDF, silently does not run and I get no value returned. I have tried variations of the string with the same results. Can someone please help. Thanks.
Use this code as the custom calculation script of the "I" field:
var h = Number(this.getField("H").value);
if (h<3000) event.value = 3000;
else event.value = h;
Copy link to clipboard
Copied
Your code is probably running just fine, it just doesn't appear to do anything that modifies the PDF in a way that you'd notice. There's not enough detail here to say for sure though. What are your actual field names?
Copy link to clipboard
Copied
Actual field names are "I" and "H". Keeping it simple. Field "H" is a field calculated by acrobat using simple field notation and correctly executes. Field I is a field that I want to either mirror field "H", or if the value of Field "H" is below 3000, then to have the returned value of Field "H" be 3000 (my minimum acceptable value ). Hope this helps you help me. Thanks.
Copy link to clipboard
Copied
Use this code as the custom calculation script of the "I" field:
var h = Number(this.getField("H").value);
if (h<3000) event.value = 3000;
else event.value = h;
Copy link to clipboard
Copied
Thank you very much. Tested it a few ways and appears to work fine.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now