These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Calculation result triggers "Fail" checkbox Export Value

latheofheaven
Registered: Nov 3 2011
Posts: 10
Answered

Hello! Hopefully you can help me with this question.
I created a calculation field. I also have two identical checkboxes with pass or fail export values.
If the calculation exceeds 1.422, I want it to automatically trigger "Fail" in the checkbox. Is there a way to do this, Please?
 
Fyi, here is the calculation in the "A" field:
 
var v1 = getField("A").value;
var v2 = getField("B").value;
event.value = v1 - v2;

"Things don't have purposes, as if the universe were a machine, where every part has a useful function. What's the function of a galaxy? I don't know if our life has a purpose and I don't see that it matters. What does matter is that we are." Ursula LeGui

My Product Information:
Acrobat Pro 10.0.1, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Accepted Answer
Just add this at the end of your code (adjust the name of the field, of course):

if (event.value>1.422) this.getField("CheckBox1").value = "Fail";

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com