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

How to change the presence dynamically of a CheckBox

GMA257
Registered: Mar 19 2010
Posts: 3
Answered

I've seen example code in FormCalc of:

CheckBox1.presence="invisible"

but it just doesn't make the checkbox invisible.
Just to make sure I wasn't doing anything foolish I started out with a functioning pdf from your web site http://partners.adobe.com/public/developer/en/livecycle/designer/pdfs/ButtonPresence.pdf which demonstrates the ability to make a button disappear. I know that this example uses JavaScript

That example works for me. So the next thing I did was edit the form in LifeCycle and drop a checkbox on to the form and add to the Button[1] click event the line:

CheckBox1.presence="invisible";

That didn't work. Just for a sanity check I dropped another Button on the form and added the line:

Button5.presence="invisible";

That works!

Checkbox is not the only object that I can't make invisible. I have tried a text object, a text field object, and a drop down list object. The only effect I get is the arrow for the drop down list object becomes invisible.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You are definately doing something wrong. Is the form saved as Dynamic? Are all the scripts set to JavaScript? Are you sure of the field names? Make sure there aren't repeated names and the button with the code is on the same hierarchy level as the field it's making invisble.

Are you seeing any errors in the Console Window?

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

GMA257
Registered: Mar 19 2010
Posts: 3
I haven't saved the example form that I downloaded from Adobe's site I just opened it in LifeCycle, made the modifications that I mentioned, clicked the Preview PDF tab and reported what I saw.

There are 0 warnings and errors reported in the report window.

I did not change the scripting it is still set to JaveScript the way that I found it.

I think I found it.

Evidently the sample form somehow works correctly when downloaded from the web and when opened in LifeCycle all of the objects that existing and were working still do. When you add new objects it doesn't work in the preview window until you perform a save as... and select a dynamic version. That begs me to ask what version was it when I first opened it in LifeCycle, static? If so then how was the original button able to disappear which is evidence of a dynamic event.

It is possible that in the Form Properties default tab that a static version was selected in the XDP Preview Format box earlier today but I've clicked and changed so many things in the last 3 hours who knows. I suppose if it were set to static the first time then every time I clicked the Preview PDF tab it kept using a static form even if I went in and changed the XDP Preview Format box to dynamic unless I closed the Preview PDF tab and forced it to re-create a new Preview PDF tab.

In any case it now works.