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

subtracting in combo form fields

marco5819
Registered: Feb 2 2011
Posts: 3

I am creating a form where the left column adds up and then is subtracted from another sum.... I cannot find how to get the form to do subtraction... I have found the addition, multiplication, min and max setting but no subtraction or division.. is there a way to do this
 
Mark

My Product Information:
Acrobat Pro 8.1.7, Macintosh
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
This is a very common question, so you'll find a lot of answers if you do a forums search.
marco5819
Registered: Feb 2 2011
Posts: 3
Thanks.. I found a reference to setting the Simplified Field notation that worked Perfect for doing Subtraction... but that opened another can of worms... Trying Division... the reference also told me that the simplified Field notation will work for division as well... BUT

Creating a form for division, using the Simplified Field notation for calculating the quotient of field 1c, I keyed in "text 1a / text1b" then closed it.. when I check the form, by inserting the appropriate numbers, and I get this warning "The value entered does not match the format of the field (text 1c)... but the form DOES work correctly.

subsequently, whenever I try to type into anyother field, I get the same javascript warning.. but again, all the calculations will work correctly.. just this pesky warning comes up every time...

Is there something I am missing that is causing this warning box to show up every time?


George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
That's another common question, and you need to use a custom calculation JavaScript.

The source of the problem you're seeing is when the divisor field is empty, it evaluates to zero, which results in the special values of NaN (if both fields are blank or otherwise evaluate to zero), Infinity (if there's a value in the numerator field), or -Infinity (if the numerator is a negative number). Since the field is set up with a numeric format, you get that error. Do another search for how to do division.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
The other option for a computer is to go to never never land. We used to have to restart computers when that calculation was attempted.

Ask yourself, what is the result whenever I divide any number by zero?

If you want to see one possible answer, change the format for the field to "None". Then look at what is displayed. Goggle that string.

There are only 3 possible character strings that can be returned and with the proper "Math" method there will only be 2. 2 of the answers are larger than google.

George Kaiser

marco5819
Registered: Feb 2 2011
Posts: 3
Thanks George,
To start, what I know about Javascript is I thought it was Java(jaba)-the Huts couzin...So, I did a search and found many answers that posted java script codes that almost worked... I found your many replies most helpful (thank you)... and I began to decipher them and put one together that .. actually worked.. I do understand the divide by zero problem that was encountered.. but never working in javescript before I found this a challenge.. which by days end was solved.. again thanks for all you past posts.. they were a BIG help.

This is what worked for me...

Mark