Skip to main content
Known Participant
March 8, 2022
Answered

interactive PDFs with boolean operations

  • March 8, 2022
  • 1 reply
  • 517 views

If an inputted number is outside of a specific range, I would like the word "fail" to appear in another field otherwise the word "pass" should populate that field

This topic has been closed for replies.
Correct answer Thom Parker

Put a custom validation script on the field that needs to be tested. Something like this:

var nMin = 3, nMax = 10;
if((event.value > nMin) && (event.value < nMax))
   this.getField("FieldStatus").value = "Pass";
else
   this.getField("FieldStatus").value = "Fail";

 

Replace "FieldStatus" with the name of the field where the status text will be displayed

 

 

1 reply

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
March 8, 2022

Put a custom validation script on the field that needs to be tested. Something like this:

var nMin = 3, nMax = 10;
if((event.value > nMin) && (event.value < nMax))
   this.getField("FieldStatus").value = "Pass";
else
   this.getField("FieldStatus").value = "Fail";

 

Replace "FieldStatus" with the name of the field where the status text will be displayed

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Known Participant
March 8, 2022

BOOM !

Worked flawlessly on first test.

THANKS A ton