I have read many posts on the subject, and most refer to Acrobat rather than Livecycle. I have tried to do a simple subtraction and multiplication combination, and am failing completely. Clearly I am doing something wrong, or am just too new at this, but please will someone help.
The calculation should be (MarkVal - BalMortgage - Penalties - SaleCosts) x PercentInt
Penalties and SaleCosts can be empty, and PercentInt is a percentage
All fields are Numeric, and the field that accepts the calculation is Equity, also numeric and the field value set to Calculated - Read Only. That field has the following script on the Calculate event - Javascript:
event.value = (this.getField(MarkVal).value - this.getField(BalMortgage).value - this.getField(Penalties).value - this.getField(SaleCosts).value) * PercentInt/100;
I get no errors, but I get no result either - any help? The only thing that might be a problem is that each of these fields is part of a Group, which is wrapped in a subform. I would attach the PDF if I could find a way.
UPDATE - removed all groups so that we now only have fields wrapped in subforms - same problem.
Livecycle ES 9.0 - Windows 7 Ultimate
In FormCalc:
MarkVal - BalMortgage - Penalties - SaleCosts) * PercentInt
In JavaScript:
MarkVal.rawValue - BalMortgage.rawValue - Penalties.rawValue - SaleCosts.rawValue) * PercentInt.rawValue;
Given of course that all the fields are in the same subform.
Notice also that "event.value" is not used.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script