Copy link to clipboard
Copied
I need to know how to get a value to return as a Yes if a certain criteria is met and No if it is not met.
If the cell named "score" returns a value of 51 or higher, then I need the cell named "Text4" to return the value Yes. If "score" returns a value of 50 or lower, then "Text4" needs to return a value of No.
The cell "score" is setup to calculates a value based on other things in the form. So the value will change as more things are marked on the form.
Thank you in advance!
Copy link to clipboard
Copied
As the custom calculation script of "Text4" enter the following:
event.value = Number(this.getField("score").valueAsString) <= 50 ? "No" : "Yes";
Copy link to clipboard
Copied
As the custom calculation script of "Text4" enter the following:
event.value = Number(this.getField("score").valueAsString) <= 50 ? "No" : "Yes";
Copy link to clipboard
Copied
Oh my gosh! You are the best. Thank you so much. You made my Friday.
Copy link to clipboard
Copied
Try67, may I ask how you are able to come up with these scripts? Is there a reference guide available to help people like me to learn these scripts? I'm looking to do something similar but have checkboxes that indicate whether someone completed or did not complete a task. I want to have a box that is similar to "text4" that will get a check mark if a number of other "no" boxes have checks in them. So they would need to calculate checked boxes for a number of boxes, and if the number exceeded a certain amount, a check would be added to the "text4" box.
Copy link to clipboard
Copied
It's not a trivial task... You need to know both the core JS syntax as well as the special objects of Acrobat JS. Here are a few good resources to get you started:
General JS tutorial (note that only the core syntax applies to Acrobat): http://www.w3schools.com/js/default.asp
Homepage of the Acrobat SDK, including a link to the full API: http://www.adobe.com/devnet/acrobat.html
Free tutorials about Acrobat in general, including many JS related ones: https://acrobatusers.com/tutorials/
A paid-for website with tutorials about Acrobat JavaScript (not related to me): http://www.pdfscripting.com/
My own humble web-site with many tools for Acrobat and Reader (mostly paid-for, some free): http://www.try67.com
Copy link to clipboard
Copied
Thank you for the follow up.