Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to create an If Then formula in a PDF

New Here ,
Apr 20, 2023 Apr 20, 2023

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!

TOPICS
How to
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Apr 20, 2023 Apr 20, 2023

As the custom calculation script of "Text4" enter the following:

event.value = Number(this.getField("score").valueAsString) <= 50 ? "No" : "Yes";

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 20, 2023 Apr 20, 2023

As the custom calculation script of "Text4" enter the following:

event.value = Number(this.getField("score").valueAsString) <= 50 ? "No" : "Yes";

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 21, 2023 Apr 21, 2023

Oh my gosh! You are the best. Thank you so much. You made my Friday.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 29, 2023 Jun 29, 2023

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.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2023 Jun 30, 2023

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 05, 2023 Jul 05, 2023
LATEST

Thank you for the follow up.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines