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

Attaching a script to a check box

wellington
Registered: Sep 19 2007
Posts: 6

I am trying to create a form in Designer which has multiple check boxes on the first page. What I would like to do is assign a script to these text boxes (I know this was possible in Lotus notes and it was called a script, I believe) to where when someone opens this PDF it is only the first page then when a box is checked, the corresponding form is added to the back of the first page. If multiple boxes are checked, each corresponding page would appear, however every page linked to that document wouldn't appear. Is there a way to do this? If I am not being clear enough please let me know and I can explain further. Thanks!

My Product Information:
LiveCycle Designer, Windows
sconforms
Expert
Registered: Jul 10 2007
Posts: 92
Sounds like your form has a main page with checkboxes and each checkbox controls the visibility of a page (which could represent a form unto itself) within the form.

If that's the case, then you would use the Object palette to set the "Presence" property of each page that should be associated to a checkbox to "Hidden" and then each checkbox would get a statement like this in its Click event (in JavaScript here):

PageX.presence = (this.rawValue == "1") ? "visible" : "hidden";

Where "PageX" is the name of the page object which should be visible if the checkbox is checked and hidden otherwise.

Stefan Cameron obtained his bachelor's degree with Honors in Computer Science at the University of Ottawa and is a Computer Scientist working on Adobe's LiveCycle server products, in particular on LiveCycle Designer ES for the past 5 years.

wellington
Registered: Sep 19 2007
Posts: 6
I'm going to be honest, this is one of the first times I have even opened LiveCycle...I didn't specify which version I had (8.0) could that change what I need to do? I tried the script you gave me and it did not work. I got as far as trying:
if (CheckBox.rawValue == false)
PageX.presence = "hidden";
else
PageX.presence = "visible";

Do you have any idea what I could be doing wrong? I know I have the correct event (click) and the "PageX" presence is set to hidden. I am wondering if I must attach a script to the page as well, not only the text box. I get no error messages or warnings on any scripting I have tried. Please help!!!