OK, this has got me stumped and I've not really been able to find the answer anywhere.
In summary, I have a petty cash form where users will enter in the value of a transaction. The user will select a radio button (GSTRowX, yes value = 1, no value = 0) to indicate if GST is acceptable.
The resulting value for the net and GST columns is calculated based on if GST is acceptable. Eg:
if (GSTRowX == 1) then NetX = GrossRowX / 11 * 10 else NetX = GrossRowX endif
I can get the values calculated using simplified field notation without a problem, it's when I go to do the if/then/else statement I get stuck.
So, here's my questions:
1) What would be the correct way to write the custom calculation script to acheive the desired result?
2) Where should the custom calculation code be run at? Should it be when a radio button in GSTRowX is selected or changed, or can the calculation be applied to NetX?
3) If the calculation field is applied to NetX, does it automatically update when the value of the radiobutton GSTRowX is switched?
All help, assistance, pointing of fingers and brickbats greatly appreciated.
Thanks in advance,
Michael Harris
Second, the programming language used to script PDF forms is JavaScript. You'll find more info in my signature block.
And last, read this article:
http://www.acrobatusers.com/tutorials/2006/form_calculations
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