Skip to main content
Participant
January 8, 2018
解決済み

Does anyone know if a field can populate a result of PASS/FAIL/COMPLIANT based on a GREATER THAN or LESS THAN number?

  • January 8, 2018
  • 返信数 1.
  • 729 ビュー

Does anyone know if  a field can populate a result of PASS/FAIL/COMPLIANT based on a GREATER THAN or LESS THAN number? Ex: below 10 - field should show text True or false

このトピックへの返信は締め切られました。
解決に役立った回答 Thom Parker

Yes, if the field containing the number is different than the field showing the text, then you'll need a calculation script in the field that is showing the text

Here's an example

event.value = (this.getField("A").value < 10)?"True":"False";

返信数 1

Thom Parker
Community Expert
Thom ParkerCommunity Expert解決!
Community Expert
January 8, 2018

Yes, if the field containing the number is different than the field showing the text, then you'll need a calculation script in the field that is showing the text

Here's an example

event.value = (this.getField("A").value < 10)?"True":"False";

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participating Frequently
January 13, 2020

I'm doing something similar to OP, but I need to return a value of "True" or "False" if the field containing the number is less than or equal to a value in another field. How do I make this syntactically correct, where Y is the second field?

event.value = (this.getField("X").value <= Y)?"True":"False";

try67
Community Expert
Community Expert
January 13, 2020

event.value = (this.getField("X").value <= this.getField("Y").value)?"True":"False";