Skip to main content
brookb60264207
Participating Frequently
September 30, 2024
Question

Calculations creating a javacript error message multiple times

  • September 30, 2024
  • 2 replies
  • 1742 views

We have two documents that were created in 2018 and use the calculations. it has been working perfectly until recently and now when we enter a number into the field it throws up a javascript error stating "The Value entered does not match the format of the field" This happens multiple times for multiple fields every time a new value is entered into a new field.

The settings have not changed but the errors have just started, we use the inbuilt calculations using the simplified field notation option.

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
September 30, 2024

Does the calculation involve division by the value of a field, by any chance?

brookb60264207
Participating Frequently
October 1, 2024

Yes all of the fields are division

 

PDF Automation Station
Community Expert
Community Expert
October 1, 2024

When you divide by zero it returns Infinity.  Before a value is entered the empty field is zero.  When any field value changes, all calculations run.  When Infinity is the value of a field that is formatted as number, the formatting error will occur.  You can avoid this by using a custom calculation division script that first tests the divisor field for a value and only runs the equation if it has a value.  Otherwise return an empty string.  Here's an example for your "ters" field.  Instead of the simplified notation listtake/ers, enter the following custom calculation script:

var oFld=this.getField("ers").value;

if(!oFld)

{event.value=""}

else

{event.value=this.getField("lisstake").value/oFld}

PDF Automation Station
Community Expert
Community Expert
September 30, 2024

The fields are probably formatted to accept a number format but the calculation is returning some that is not a number.  Can you upload the form?  It's hard to troubleshoot based only on a description.

brookb60264207
Participating Frequently
October 1, 2024