Skip to main content
New Participant
May 7, 2025
Answered

basic simplified notation get the value entered does not match the format of the field error

  • May 7, 2025
  • 2 replies
  • 1022 views

I have a form that has data entry field called SW (setup as required, number to 1 decimal point) then results field (SW6, view, number to 1 decimal point) simplified field notation 45/SW, the form does the calculation but i get the error "the value entered does not match the format of the field

SW field will only have possible entry of 1 thru 8


In the same form I have another data entry field AW (setup as required, number to 1 decimal point), then another results field (AW6) which does a simplified field notation AW*45, which does not get the error.

I've tried various things like removing required, or view, does not make a difference. 

 

Not sure what to do.  Why does it work in one spot and not the other?

Correct answer PDF Automation Station

when I view the pdf in a browser everything works fine no errors.  When i view the pdf in acbrobat reader dc I get the error.

 

When i'm in acrobat in edit mode  and do a preview works with no errors, but when I clear the form  that is where I get the errors as well.


I repeat, the error is from division by zero when the field is empty.  Use the following custom calculation script instead:

if(this.getField("SW").value)

{event.value=45/this.getField("SW").value}

else

{event.value=""}

2 replies

PDF Automation Station
Community Expert
May 7, 2025
New Participant
May 9, 2025

great, that works now,  thanks so much

ls_rbls
Community Expert
May 7, 2025

Hi @michelle_8298 ,

 

This simplified field notation (SFN) of 45 divided by a value entered in field SW (45/SW) seems OK.

 

However, as explained in the article linked below, Field Names are interpreted as operands. Besides that point, it seems like using SFN in Acrobat is a little clunky when emplying a division like that. 

 

In which case, because the entire line of characters in that code is all stuck together, try doing it like : (45)/SW , (45+0)/SW or using a space 45 / SW.

 

 

After testing it like that a few times, it didn't throw that error if I switched it back  to 45/SW

 

New Participant
May 7, 2025

I tried each one of the combinations and still get the same error.  The calculation works on all of the combinations

PDF Automation Station
Community Expert
May 7, 2025

when I view the pdf in a browser everything works fine no errors.  When i view the pdf in acbrobat reader dc I get the error.

 

When i'm in acrobat in edit mode  and do a preview works with no errors, but when I clear the form  that is where I get the errors as well.


I repeat, the error is from division by zero when the field is empty.  Use the following custom calculation script instead:

if(this.getField("SW").value)

{event.value=45/this.getField("SW").value}

else

{event.value=""}