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

Scripts for auto ranking in PDF Form?

Community Beginner ,
May 03, 2024 May 03, 2024

Copy link to clipboard

Copied

Hi, I'm just now learning how to add scripts to PDF Form calculations, so any help at all is greatly appreciated.  I've attached an example of what I'm trying to accomplish.  I have 3 simple division equations listed, and would like the user to input numbers (between 1 and 10) into each equation.  The PDF form would then calculate the quotient of each equation. I have been able to program that part, but it's the next 2 parts I'm not sure how to do -

I would then like the form to assess the 3 quotient values, and next to each one add a ranking number: 1, 2, or 3. (For the purpose of this exercise, the lowest number would receive the highest rank - #1)

Finally, I would like it to then populate a text line that puts the equation names in rank order: i.e. "Equation Name [rank1], Equation Name [rank2], Equation Name [rank3]"

Hopefully the attached PDF illustrates the example more simply than my description.  The top half shows what I'm trying to accomplish, and the bottom half is where I began to actually populate a Form. (As mentioned, I was able to populate the Quotient values, but am lost after that.) I have currently manually populated the rankings, but am hoping to automate it through a script.

Any help would be greatly appreciated!  Thank you!!

TOPICS
How to , JavaScript , PDF , PDF forms

Views

88

Translate

Translate

Report

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 ,
May 04, 2024 May 04, 2024

Copy link to clipboard

Copied

LATEST

If you use simplified field notation for division, you will get an alert when the denominator field is empty or 0, so instead you should use a custom calculation script.

What should happen if two "Quotient" fields have the same value, how do you decide rank then?

 

 

 

Votes

Translate

Translate

Report

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