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 [sf_dm]

cwo
Registered: Jul 25 2010
Posts: 1

Help me please .....

var a = this.getField("dm_transp");
var b = this.getField("dm_e_total");
var c = this.getField("dm_s_total");
var d = this.getField("sf_dm");
d.value = a.value+b.value-c.value;

the problem its only when the result is zero

real sample:

a = 273,55
b = 2974,40
c = 3247,95

then the result is 0,00 and i receved this message of the error above

thanks for any help ......

My Product Information:
Acrobat Pro Extended 9.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
It appears you are entering a 'Custom JavaScript Calculation' in a form created by Acrobat and not a LiveCycle Designer form, and as such you need to use the correct syntax to set a field's value. The set the value for the field with the above script, you need to reference the 'event.value. You should specify the format for the fields to insure the expected values are entered into the fields.
// access some fieldsvar a = this.get Field("Dem_trans");var b = this.get Field("Dem_e_total");var c = this.get Field("Dem_s_total");// var d = this.get Field("sf_Dem");// set the value of this field to the sum of the selected fieldsevent.value = a.value + b.value - c.value;

If you are going to be writing more JavaScript, you might want to look at the tutorials, articles, and eSeminars on demand at this site.
Since it appears you are using a field with a calculation, you need to make sure that that field is calculated as expected. Sometimes a field that is assumed to be a numeric field, is treated as a character string field and this raises formatting issues. You may need to use the 'Number()' constrictor to force a value to a numeric value or the 'isNaN()' function to identify a value that is 'Not a Number', and adjust your calculation as necessary.

Are you performing a division computation within the form?

If so, you need to prevent the division by zero or null.

[url=http://www.acrobatusers.com/tutorials/2006/form_calculations]How to do (not so simple) form calculations[/url] by Thom Parker.

George Kaiser