Skip to main content
Inspiring
January 22, 2026
Answered

Simple "IF" statement in forms

  • January 22, 2026
  • 2 replies
  • 43 views

I am trying to accomplish this in the calculation script area on my form: If Text1's total is greater than 0 then Text2 = AK. I have other scripts in my form that accomplish this, however, those are based on exact text versus this situation needing to be based on the "total" or "value" of Text1 being greater than 0, if that makes any sense! For an excel adjacent example =IF(Text1>0,"KY","")

Correct answer PDF Automation Station

Custom calculation script in Text2:

 

if(this.getField("Text1").value>0)

{event.value="AK"}

else

{event.value=""}

 

Make sure Text1 is formatted for numbers.

2 replies

JR Boulay
Community Expert
Community Expert
January 22, 2026

Please note that JavaScript is case sensitive, so If is not the same as if.

Acrobate du PDF, InDesigner et Photoshopographe
PDF Automation Station
Community Expert
Community Expert
January 22, 2026

Custom calculation script in Text2:

 

if(this.getField("Text1").value>0)

{event.value="AK"}

else

{event.value=""}

 

Make sure Text1 is formatted for numbers.