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

the value entered does not match the format of the field

EllenG
Registered: Aug 1 2008
Posts: 6

I am getting the message "the value entered does not match the format of the field" when doing a simple subtraction.
This is not during a division by 0, which is when all the other incidents I found by searching on the web occur.

I've put the following JavaScript to function onBlur for the numGrossWt1 field:

var gross = this.getField("numGrossWt1");
var remG = this.getField("numRemGrossWt1");
var net = this.getField("numNetWt1");
var remN = this.getField("numRemNetWt1");
var tare = this.getField("numTareWt1");

remG.value = gross.value; //this works

net.value = gross.value - tare.value;
remN.value = net.value;

When the error occurs, the cursor is in the numRemNetWt1 field, and both it and numNetWt1 are blank. Therefore I presume the error is in putting a value in the numNetWt1 field.

I first thought it was because all fields are formatted as a number with 2 decimal places, and I was only entering one decimal. But it still occurs when two decimal places are entered. I even tried x.valueAsString, but it seems to make no difference.

If you tab to the Gross Wt field and away two times, the Net Wt fills in and errors both times. The third time, the Rem Net Wt fills in and the error does not occur.

My Product Information:
Acrobat Pro 8.1, Windows
EllenG
Registered: Aug 1 2008
Posts: 6
I figured it out from the answer to another post: http://www.acrobatusers.com/forums/aucbb/viewtopic.php?pid=29207#p29207

There was a leftover calculation on the Net Wt field that interfered with calculating it from the Gross Wt. When calculation from the Calculated tab didn't seem to work, I'd done it onBlur from the Gross Wt, but that apparently is lower precedence to the Calculated tab.

Once failed Calculation removed, it works.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
When you run into a problem like this there are a couple of things that could help track down the problem.

First, as you did, note the result values, fill in one new value and note the results. If the new value results in the values for the previous values, then you have a field calculation order.

Next, one could set the result fields for a calculation to text and see what happens. If the value of "NaN" appears there maybe a string being used in a calculation. If a value of "Infinity" or "Negative Infinity" appears there is a division by zero.

Then one could add some statements to display in the JavaScript debugging console the values being processes and the results:

var gross = this.getField("numGrossWt1");
var remG = this.getField("numRemGrossWt1");
var net = this.getField("numNetWt1");
var remN = this.getField("numRemNetWt1");
var tare = this.getField("numTareWt1");

console.show(); // bring up JS console
colsole.clear(); // clear the intro messages
// display input:
console.println("gross: " + gross);
console.println("regF: " + remG);
console.println("net: " + net);
console.println("remN: " + remN);
console.println("tare: " + tare);
// display computation results:
console.println("remG.value = gross.value = " + remG.value = gross.value);
console.println("net.value = gross.value - tare.value = " + net.value = gross.value - tare.value);
console.println("remN.value = net.value = " + remN.value = net.value);
// end debuggng statements

remG.value = gross.value; //this works

net.value = gross.value - tare.value;
remN.value = net.value;

George Kaiser

helgas
Registered: Oct 19 2009
Posts: 1
Hi,

I have a form where I have calculation in fields and everthing was working fine until I created a buttom for reset the form then I get the message The value entered does not match the format of the field In every field were I dont have filled in numbers. I have already deleted the buttom but I still get this warning.

My Java in the calculation in this field is

event.value = (this.getField("Heildarinnheimta").value) / (this.getField("Text1").value);

why is this happening i can't let anyone use the form and have this warning in all off these fields.?
How can I stop this warning?

Please help me :-)