I am writing custom calucation script to calculate monthly loan payments. I am using:function Monthly(principal, years, apr)
{
rate = this.getField("apr").value / 12;
payments = this.getField("years").value * 12;
event.value=this.getField("principal").value * rate / (1 - (1 / Math.pow(1 + rate, payments)));
}
And it's not working... why?!
Are the fields named correctly?
Are there any reported errors?
Have you tested the function outside the calculation script?
There is no need to place this code in a fucntion. Just place the calculation code in the script.
You need to learn some debugging techniques. This article might help.
[url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/javascript_console/]http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/javascript_console/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script