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

Calculation Scripts with Check box input needed

KValleyMB
Registered: Oct 12 2011
Posts: 8
Answered

Very new to Adobe forms so please be patient.
I have created a form that has a Check Box(BLCheck) that needs to return a value to BLFees using "Term" as its basis. So if the BLCheck is unchecked the fee in BLFees is 0.00, but if the BLCheck is checked then the BLFees should go to "Term" and return that value. "term" can have 1 - 12 as its value so if the multiplier were 1 and Term were 12 then the "BLFees" should be 12.
 
Thanks for any help you can give. I am trying to learn this stuff, but have little experience in it and little has worked form the internet... any training manuals suggested?
 
Randy

My Product Information:
Acrobat Pro 9.4.3, Windows
PDFchild
Registered: Oct 31 2010
Posts: 44
Can you post the form somewhere? You can use Mediafire

For a manual You can buy Ted Pedova's Acrobat PDF Bible

PDFchild [at] gmail [dot] com - Go Green Save Paper Adopt a PDF

KValleyMB
Registered: Oct 12 2011
Posts: 8
PDFCHild,
Thanks for getting back to me so quickly, working on something that has copy right info on it... will try to make up a simple version with just the buttons affected by the calculations.Check your inbox soon.

Randy
PDFchild
Registered: Oct 31 2010
Posts: 44
Got your mail. Just post a dummy form. Post it here :-)

PDFchild [at] gmail [dot] com - Go Green Save Paper Adopt a PDF

PDFchild
Registered: Oct 31 2010
Posts: 44
same book for LiveCycle :)

PDFchild [at] gmail [dot] com - Go Green Save Paper Adopt a PDF

PDFchild
Registered: Oct 31 2010
Posts: 44
There was a little problem with the code use this one and note the difference

if (this.getField("BLCheck").value=="Yes") {
event.value = this.getField("Term").value * 11;
} else {
event.value = "0.00";
}

This one will work.

PDFchild [at] gmail [dot] com - Go Green Save Paper Adopt a PDF

KValleyMB
Registered: Oct 12 2011
Posts: 8
AHHH I see that I forgot some items, but tried pasting this code into the BLFees Calculate, then running the form. Nothing happened, could I be missing something?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Any errors in the JS console?

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

KValleyMB
Registered: Oct 12 2011
Posts: 8
I am getting the following Console responses when the Check boxis enabled:
Acrobat JavaScript Debugger Functions Version 9.0
Acrobat EScript Built-in Functions Version 9.0
Acrobat Annotations / Collaboration Built-in Functions Version 9.0
Acrobat Annotations / Collaboration Built-in Wizard Functions Version 9.0
Acrobat SOAP 9.0

SyntaxError: missing ; before statement
3:Field:Calculate
This is all I show in the Console window for this event.
The other item is just an addition script for a total amount which included BLFees +Registration costs... this works fine if I enter in a BLFees amount so I dont think this is an issue...I am working piece by piece and this BLFees relly has me at my wits end... Any help is greatly appreciated.
Randy

try67
Expert
Registered: Oct 30 2008
Posts: 2398
So there is an error... Could you post the full code of the Calculate event?

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

KValleyMB
Registered: Oct 12 2011
Posts: 8
Have responded directly to any helper with the error codes, and the form in question. to date nothing has worked. Have pasted the code above into the calculations field and it does not return any data. But if I type an amount in it the Total comes out correctly.... not sure what to do at this point, but if there are any other ideas I would be happy to test them. Off to purchase a few training books this evening.... my work has me doing forms in Adobe and the more I know the better I am for them. If I knew how to post my dummy form here I would.

Thanks all for helping me understand a bit better,
Randy
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Accepted Answer
If you wish, you can send me the file by email and I'll have a look at it.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

KValleyMB
Registered: Oct 12 2011
Posts: 8
After sending the form, Try67 found a mispelling and the order of calculations off.
Thanks so much