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?

"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
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Accepted Answer
Read this:
http://acrobatusers.com/tutorials/conditional-execution

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

latheofheaven
Registered: Nov 3 2011
Posts: 10
Thank you for responding! Using the caluclations on that page you reocmmended, I got part of the problem to work. Now it selects "Pass" or "Fail" depending on the calculation, but they want a third choice, Fail: Marginal, that triggers when the amount is between 1.421 and 1.777.

Also, they want an app.event that says: Pass or Fail.

"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

latheofheaven
Registered: Nov 3 2011
Posts: 10
Here's my code presently:
var v1 = getField("A").value;

var v2 = getField("B").value;

to the difference event.value = v1 - v2;

if (event.value <1.421) this.getField("Fail or Pass").value = "Pass";if (event.value>1.778) this.getField("Fail or Pass").value = "Fail";Now I want to add an event value that works if the amount is between 1.421 and 1.777.
Thanks, in advance, for any help.

"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

latheofheaven
Registered: Nov 3 2011
Posts: 10
By the way, I already added a box to the "Pass or Fail" boxes.

One box outputs "Fail" and one box outputs "pass" and now I want to output "fail marginal" to complete.

"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

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Look at that article again. You need to use an if/else if/else structure.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script