These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Value entered does not match format of the field

David Dunn
Registered: Oct 28 2010
Posts: 116

I am employing a calculation for rounding (courtesy of George Johnson) in 2 fields. Both fields are formatted the same, as a number field with a comma at the thousandths place and 2 decimal places. The formula works fine in one of these fields but the second field returns an error message that the value entered does not match the format of the field.
 
What can account for this error message in one field but not the other?

David D

My Product Information:
Acrobat Pro 9.4, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Can you post the script?
lmcavoy
Registered: Dec 14 2010
Posts: 1
Hello,

I was receiving the same error discussed here and I've tried using this code:

// Custom calculation script(function () { // Get field values as numbersvar v1 = +getField("Jan-TourGoal").value;var v2 = +getField("Jan-InqGoal").value; // Perform calculation if denominator is not zero (or blank)if (v2 !== 0) {event.value = 1 - v1/v2;} else {event.value = "";} })();.

But it will not calculate, the percentage remains 0% even when numbers are entered in the the dividing cells. What am I doing wrong?

Thanks!
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Make sure the field calculation order is correct.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Is your script formatted as you posted it?

It should be formatted as:

// Custom calculation script
(function () {
// Get field values as numbers
var v1 = +getField("Jan-TourGoal").value;
var v2 = +getField("Jan-InqGoal").value;
// Perform calculation if denominator is not zero (or blank)
if (v2 !== 0) {event.value = 1 - v1/v2;} else {event.value = "";} })
();

The line that starts with "//" is a comment.

What is the format for your fields?

What are the values you are trying to use?

It is possible you are getting an "NaN" (Not a Number) result or one of the 'Infinity' results.

What happens when you change the format of the result field to 'None'?


George Kaiser

David Dunn
Registered: Oct 28 2010
Posts: 116
I apologize for not posting my script when you asked for it. I apparently solved my problem but don't know what I did, and was unable to re-create it.

David D