2 Replies Latest reply on Feb 24, 2009 3:00 PM by (Chad_Hissong)

# How to write a subtraction problem in script?

Hi,
I am very very new to Adobe and right now I have version 9. I have figured out how to plus, multiply, average, max, and min. But for some reason they don't have a subtraction under there. So someone told me I would need to write script, and I have never written script before and am not finding any help online yet. So here is the senerio: Lets just say I estimated a amount to use to purchase something, ex: \$100. OK now down below my for I have a field that has total spent, ex: \$200. Now in another field I need to be able to subtract total spent and estimated amount to give me the excess spent. email me at chissong@esu7.org

I hope this makes since, and I hope someone will be able to help me.

Thanks
• ###### 1. Re: How to write a subtraction problem in script?

http://www.acrobatusers.com/tutorials/2006/form_calculations

If you want to learn or get a better understanding about scripting in Acrobat and PDF you should consider a membership to www.pdfscripting.com- the most comprehensive resource available on the topic.

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
www.pdfscripting.com
• ###### 2. Re: How to write a subtraction problem in script?
So for this calculation it would take 200 - 100 and give me a total of 100, that is fine. Now there are several of the total field and when I told them up it doesn't calculate right.

If this formula is a little off please let me know.

//
var f = this.getField("Total Due1");
var g = this.getField("Total Meals");
event.value = f.value - g.value;
//