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

How to populate a text field based on a range of numbers in another text field

New Here ,
Aug 22, 2024 Aug 22, 2024

Copy link to clipboard

Copied

I have a text field "Overall Performance" that needs to auto populate one of 3 possible words, based on a score number in another text field "Total Score". The "Total Score" field on page 1 is already set to display the number from the same field on page 12 by having both boxes named the same. The "Total Score" field on page 12 is set to calculate a sum and multiply it by 0.01. On page 1, the "Overall Performance" box should display one of the following words based on the "Total Score" number range:

 

Total Score = 2.50 to 3.00, Overall Performance = Exceptional

Total Score = 1.50 to 2.49, Overall Performance = Successful

Total Score = 0.00 to 1.49, Overall Performance = Unsuccessful

 

I need these words to auto-populate into that field and not be a user-selected field, like a drop down. I've been searching for how to do this and have seen other solutions using some coding in the validation script box, but I unfortunately just don't know or understand enough about the coding to figure out how to get it to work for this particular need. Hoping someone can help me out with this!

 

 

TOPICS
How to , JavaScript , PDF , PDF forms

Views

86

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

correct answers 1 Correct answer

Enthusiast , Aug 22, 2024 Aug 22, 2024

Enter the following custom calculation script in the Overall Performance field:

var total=this.getField("Total Score").value;
if(total <= 1.49)
{event.value="Unsuccessful"}
else
if(total > 1.49 && total <= 2.49)
{event.value="Successful"}
else
{event.value="Exceptional"}

Votes

Translate

Translate
Enthusiast ,
Aug 22, 2024 Aug 22, 2024

Copy link to clipboard

Copied

Enter the following custom calculation script in the Overall Performance field:

var total=this.getField("Total Score").value;
if(total <= 1.49)
{event.value="Unsuccessful"}
else
if(total > 1.49 && total <= 2.49)
{event.value="Successful"}
else
{event.value="Exceptional"}

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
New Here ,
Aug 22, 2024 Aug 22, 2024

Copy link to clipboard

Copied

LATEST

Thank you SO much! I tested it in all three ranges and it worked perfectly!

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