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

Spawned page calculations

djfixxx
Registered: Mar 22 2007
Posts: 111

I am having an issues with spawned page calcs but have not seen a working formula. can you help with a working formula.
I basically have QTY + Price = Amount calc and then a simple amount.1 + amount.2 = total

It professional, networking, technical, graphical, imaging, froms.

My Product Information:
Acrobat Pro 8.0999999999999996447286321199499070644378662109375, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Since you mention spawned pages, then I'm assuming you are working with AcroForms. A spawned page can be set up to either rename the fields, which is the right way to do it. All the the fields on a page are renamed in the same way, with a prefix using a dot notation. All the calculation script needs to do is to determine what the field prefix is for the page, and it can do this by examining it's own name.

For Example:

// split field name on dots.
var aName = event.target.name.split(".");

// remove the original name
aName.pop();

// Build Prefix
var prefix = aName.join(".");

// Do Calculation
event.value = this.getField(prefix + ".QTY") * this.getField(prefix + ".Price");

Of course if you are tolking about dynamic xfa forms the process is very different.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

djfixxx
Registered: Mar 22 2007
Posts: 111
I dont quite get it. I guess I cannot use Simple Calculations. Am I forced to use Javascript when soing this?
I posted the PDF here if you could help.

[url=http://www.rockndj.com/PurchaseOrder-PurchaseRequest.pdf]http://www.rockndj.com/PurchaseOrder-PurchaseRequest.pdf[/url]

It professional, networking, technical, graphical, imaging, froms.