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

LiveCycle - Checkbox Show/Hide Image Field - How to

sboyse
Registered: Mar 22 2009
Posts: 10

This might be a bit of a simple question, but all my searches are bringing up Acrobat answers.

Is it possible (and if so, how) to use a check box to hide and/or show an image field?

In the end I'll need the various check-boxes to hide not only specific image fields, but also multiple text fields. Checkbox options were not a problem in Acrobat (in fact were very simple) but Acrobat lacks the ability to add image fields. However if I'm totally wrong and via some method other than, oh lets say black magic, I can start shoving image fields into Acrobat that would circumvent the checkbox problem I'm having with Livecycle.

LiveCycle ES 8.2
Acrobat 9 Pro

Jimmy0306
Registered: Dec 11 2008
Posts: 32
I don't know if this will help, but I had the same problem with LC a while back. First I had to save the document as "Dynamic" instead of "Static". The code was something like this:
Set this.presence="hidden" using Javascript in the docready for all fields you want to hide when the pdf loads.
Then in the change event for the Checkbox using FormCalc use something like this:

if ($.rawValue == 1) then
Image.presence = "visible"
TextField1.presence="visible"
TextField2.presence="hidden"
TextField3.presence="visible"
else
Image.presence = "hidden"
TextField1.presence="hidden"
TextField2.presence="visible"
TextField3.presence="hidden"
endif

In my test form i have three text fields, a checkbox and an Image Field. When the form loads only the checkbox and TextField2 are visible. When the box is checked, the image and TextFields 1 and 3 appear.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Actually, Acrobat (AcroForm) does have an image field, the button. Buttons can show images and be setup to load an image dynamically. They can even submit an image just like it was data.

But if you'd like to use the dynamic features on a LiveCycle form I'd suggest you watch this video.
https://admin.adobe.acrobat.com/_a200985228/p87746471/

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