Hello
I'm doing a 3 pages form with different calculations, and I can't get it to work. This is my first problem (I use Acrobat 7):
On page 2 I have a column where you add a positive number and withdraw a negative number and get a sum. This sum should automatically go to page 3. If it's a positive number it should go to one column and if it is negative to another.
This is the script for the positive value and it doesn't work:
var summa = this.getField("Vinst42").value;
if (summa > 0) event.value = summa;
This is the one for the negative value and it works sometimes:
var summa = this.getField("Vinst42").value;
if (summa < 0) event.value = -Math.abs(summa);
+300
-500
=-200
the -200 ends up in the right place, but the +300 end up in the positive field that should be empty in this case.
I don't know anything about Java, can you help me and say what is wrong?
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script