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

Need Help - Multiplication and Division formula

sammie
Registered: Nov 8 2011
Posts: 3

I am trying to create a formula that will multiply two numbers then divide by the third.
 
Field 1 & 2 are user input fields and field 3 is an auto calucalting field from a user input in a separate field.
 
This is what I have so far...
 
event.value=this.getField(‘field1’).value*this.getField(‘field3’).value/this.getField(‘field2’).value;
 
If I remove --> *this.getField(‘field3’).value the divsion part of the fomula works fine. It is just when I try to multiply in field 3 I have troubles.
 
Can anyone see what I am missing.

My Product Information:
Acrobat Pro 10.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Can you be more specific about the properties of each field?

For test values what are the results you expect and the results that you are receiving.

A null value can be treated either as a character text value or as a numeric value depending upon how it is used and JavaScript thinks it format should be. This causes an issue with addition/concatenation and division operations. In addition a null value is treated as a character string and values are concatenated and not added. In division, a null value is treated as the number zero and division by zero can be one of the infinities or not a number.

You could also have a problem with the order in which the fields are calculated.

You might want to set the format of the field in which your calculation script is placed to a format of "None" and observe the results when various entries are made.

George Kaiser

sammie
Registered: Nov 8 2011
Posts: 3
George - thanks for all the leads. I went through them all and managed to get the formula to work great. Thanks for your help!!