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

Problems with calculations in Acrobat 6.0

bbruno
Registered: Aug 9 2007
Posts: 6

Hey guys --

Quick question for some of you that are more of an expert at this than I am. I have been playing around with forms a bit. Been working ok til it came to working with the calculations. Seems like the calculations work fine up until they start getting more complicated and then they just quit working. Fine as long as "add this field, this field and this field" = subtotal THEN the problems come when i start working with the subtotal field...when i start trying to then say "subtotal field x .10"= subtotal 2" That even works. However, when I say "subtotal2x.15" XXXXXXXX does not work.

Question: is that to complicated for the simple calculations OR is it a problem with Acrobat 6?? Problem is I am not really that great with Javascript. That would figure out the calculations easily...

HEELLLPPPP!!

bbruno
Registered: Aug 9 2007
Posts: 6
think i got it. Used the reduce file size feature...and that seemed to have taken care of the bugs.
bbruno
Registered: Aug 9 2007
Posts: 6
And now the bugs are back...gggrrrrrrrrrrr
schiilligm
Registered: Dec 9 2009
Posts: 7
I have a similiar problem with more complicated calculations:

I can subract (ie: b-c) in custom calculation script property box but when I use b-(c+d) It won't work.

var a = this.getField("aRow1").value; // variable for Grant award
var b = this.getField("bRow1").value; // variable for the present request amount value
var C = this.getField("cRow1").value; // variable for the previous funds value
event.value = a - ( b + c ) ; // formula

Is there a way to hold a subtotal value without displaying?
Someone can really make my day if they can fix my script! Please help!
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
You have to spell and capitalize your variable names in a consistent manner. You have a capital 'C' for the variable declaration and use a lower case 'c' in the calculation. But this could be a typo error.

var a = this.getField("aRow1").value; // variable for Grant awardvar b = this.getField("bRow1").value; // variable for the present request amount value// note capital 'C"var C = this.getField("cRow1").value; // variable for the previous funds value// make 'c' a capital 'C'event.value = a - ( b +  C ) ;  // formula

Are you getting any errors in the Acrobat JavaScript debugging console? Open it an look do not assume it will pop-up.

Have you checked the field calculation order?

George Kaiser

schiilligm
Registered: Dec 9 2009
Posts: 7
That was a typo. It wasn't in my custom script.

There is no error it just won't calculate. If I just have the b - c it calculates fine and displays the value.

What am I doing wrong? Is there a way to have a variable hold the subtotal?

Thanks for all of your help!
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi schiiligm,

Your script works for me in Acrobat 8- what version of Acrobat are you using- what program did you create the form in( Acrobat or LiveCycle Designer)?

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
schiilligm
Registered: Dec 9 2009
Posts: 7
Acrobat9

I have not used live cycle in a while.

Acrobat9 will not display my event.value - it will if I only have a- c or a-b but not the complete
a - ( b + c ) formula.

This is my script:
var a = this.getField("bRow1").value; // variable for Grant award
var b = this.getField("cRow1").value; // variable for the actual value
var C = this.getField("dRow1").value; // variable for the actual value
event.value = a - ( b + c) ;
// formula

All your help is appreciated!
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi schiilligm,

Well, as Gkaiseril pointed out earlier, there is still that capital "C" in the script and this does cause an error message. Where are you placing this script?

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
schiilligm
Registered: Dec 9 2009
Posts: 7
Ooopppsss! Hello and it is not Monday!


Thanks to all of you for your help! Yes! It WAS a Capital C.