Skip to main content
Participant
April 13, 2026
Answered

I need a script that looks at a field and calculates a tolerance then looks at a separate text field and makes sure it is within that tolerance and places pass or fail in a separate text field

  • April 13, 2026
  • 1 reply
  • 51 views

I need a script that looks at a field and calculates a tolerance then looks at a separate text field and makes sure it is within that tolerance and places pass or fail in a separate text field

    Correct answer Thom Parker

    Calculation scripts can be tricky because they are executed anytime any field on the PDF is changed. So extra care has to be taken to ensure calculations are done in the proper order and that scripts don’t interfere with one another.  

    The behavior you’ve described could indicate out of order calculations. Try checking the calculation order. 

     

     

    1 reply

    Thom Parker
    Community Expert
    Community Expert
    April 13, 2026

    Sounds like you need a calculation script, in the text field that shows the Pass/Fail indication. 

    https://www.pdfscripting.com/public/How-to-Write-a-Basic-PDF-Calculation-Script.cfm

     

    Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
    Participant
    April 13, 2026

    Yes been trying to write one but cannot seem to get one that will work.  A script may work once then the next time it does something different.

    Thom Parker
    Community Expert
    Thom ParkerCommunity ExpertCorrect answer
    Community Expert
    April 13, 2026

    Calculation scripts can be tricky because they are executed anytime any field on the PDF is changed. So extra care has to be taken to ensure calculations are done in the proper order and that scripts don’t interfere with one another.  

    The behavior you’ve described could indicate out of order calculations. Try checking the calculation order. 

     

     

    Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often