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

Add / Delete document page based on three scenarios

jenniferbunecke
Registered: Jul 29 2009
Posts: 35
Answered

I am a javascript newbie...

I developed a form in LiveCycle that automatically inserts a page if one of three checkboxes are marked. I can't figure out a way to hide the page if all three checkboxes are not selected. I can easily make the page disapear if checkbox "a" is not marked, or if checkbox "b" is not marked, or if checkbox "c" is not marked. I am having problems developing a script that checks if checkbox "a", "b", and "c" are not marked, then hide the page.

I already have if then statements within my click and initialize sections.... can I add two separate scripts to one event?

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You have two different issues here, 1) hiding and showing a page, and 2) writing a script the uses the values of 3 check boxes in a calculation. It sounds like you know how to do issue 1)?

The solution to issue 2) is script placement. Since the script uses all 3 checkboxes it should not be on any one of them. The script needs to be run when any of the check boxes is changed, so the obvious choice is a calculation script. Create a hidden text box that runs the script.

Another option is to place the script in a function in a scripting object. Then call it on click event in each check box.

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