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

Altering visability of images by url var

mazzamuz
Registered: Feb 10 2008
Posts: 11

hello ive been using a method as shown in:

http://forms.stefcameron.com/2006/10/20/using-url-requests-in-pdf-forms/

I need to alter the appearance of an image field from hidden to visable.

IE I need to alter the properties of the image field via javascript in the PDF.

so far ive got.

if (sName == "ImageField1")
{
//sName will be set to visable depending on what image i need to make visable.
Image1.display.visible;
// or Image1.display.sName;
// reverse - Image1.display.hidden;
}

this isnot working as i need to know how the reverence the display property or similar

any ideas?

ciao

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The "field.display" property is for fields in an AcroForm and you've indicated that you are using LiveCycle Designer. This could be the problem;)

This visibility property in LiveCycle is "presense".

You can find out more about this by attending this online seminar

http://www.acrobatusers.com/events/online/245/

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

mazzamuz
Registered: Feb 10 2008
Posts: 11
thank you for the reply and the guidance...

ill try make the seminar however its at 1AM in my time.

I found you example :
http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=3154

if(xfa.event.change == "MyValue")
Txt1.presense = "visible";
else
Txt1.presense = "invisible";

Ive tried it as

if (sName == "ImageField1")
{
TextField1.rawValue = sValue;
Image1.presence = "visible";
}

to no avail

regards
mazzamuz
Registered: Feb 10 2008
Posts: 11
im trying to get to posting visible across in the url :

if (sName == "ImageField1")
{
//TextField1.rawValue = sValue;
//Image1.presence = "visible";
Image1.presence = sValue;
}
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You've got the right idea. However, you've also got a lot of different things going on and you need to test each one individually to make sure they work.

First, showing and hiding fields will only with a "dynamic" form. Make sure you are saving you form as "Dynamic, Acrobat 7". A good way to test this is to put buttons on the form that force the field to show and hide, then you know the visibility setting works.

The next bit you have to worry about is parsing the URL. Is this happening correctly? To debug the code you'll need to use the console window. You can read about it here.

http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/javascript_console/

Place console.println() statments at every stage of the URL parsing. Have them print out the results of the code so that you can see exactly what's going on.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script