Skip to main content
Participant
January 8, 2025
Answered

Adobe form fill - make box 0 when no other number imputed

  • January 8, 2025
  • 1 reply
  • 239 views

Currently have a file that has a 'calculation'. so the customer imputs a few numbers and at the end there a 'total savings'. My issue is that the 'total savings' is 2 fields subtracted from eachother + $15. so: (field 1 - field 2)+15. When the form is completly blank with no other numbers, the field is defaulting to show $15. Any way I can remove this so the calculation doesnt work unless the rest is filled out?

Correct answer PDF Automation Station

Use a custom calculation script:

var fld1=this.getField("field 1").value;

var fld2=this.getField("field 2").value;

if(!fld1 || !fld2)

{event.value=""}

else

{event.value=fld1 - fld2 + 15}

1 reply

PDF Automation Station
Community Expert
Community Expert
January 8, 2025

Use a custom calculation script:

var fld1=this.getField("field 1").value;

var fld2=this.getField("field 2").value;

if(!fld1 || !fld2)

{event.value=""}

else

{event.value=fld1 - fld2 + 15}

Participant
January 8, 2025

thank u!!