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

How do I add a percentage to a form field???? help

buzzmonkey
Registered: Mar 4 2008
Posts: 40

Sorry all, may be a very basic question...but I have a number of fields that add together and I want to add 10% to the subtotal, how do I go about doing this....thanks in advance..

My Product Information:
Acrobat Pro 8.1.2, Macintosh
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
You may want to provide some more information about how you've set up the form. Do you have a separate field that you want to place the 10% figure into?

George
buzzmonkey
Registered: Mar 4 2008
Posts: 40
Hi George,

Thanks for the reply, yes I have it set up like an invoice with a various total fields, then a subtotal field that adds together the total fields...
Then I have to add 10% (which is the GST field), thanks again
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
OK, I can show you the general approach, but realize when dealing with money, and taxes in particular, you have to round according to whatever rules you're compelled to adhere to. I'll conveniently ignore that part.

The following code is intended to be a custom calculation script for the GST field:

// Get the value of the subtotal field
// multiply it by the tax rate
// and set this field's value equal to the result
var tax_rate = 0.1;
event.value = getField("subtotal").value * tax_rate;


Your grand total field would then calculate the sum of the GST and the subtotal field.



George
buzzmonkey
Registered: Mar 4 2008
Posts: 40
Thanks so much, works like a charm...