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

Script to hide drop down list from being printed

boourns
Registered: Apr 11 2011
Posts: 10
Answered

In LiveCycle Designer ES2, I have created a drop down list which selects certain company logos to appear on the title page of a document. That is all working fine but I want the drop down list to be hidden when the document is printed. What code should I be including in the script to make this happen?

Here is the document that I have been working on if this helps

Below is the current coding that I have so far;


topmostSubform.Page1.Subform1.DropDownList1::change - (FormCalc, client)
// Code written by Tim Huff - Business Development Manager for Acrobat Sept 9 2007

// Populate a variable (sNewValue) with the Current Value of the Drop-down list using the newText event.
var sNewValue = $.boundItem(xfa.event.newText)

// Test your variable agaist the name of the Image Object. The names for each Image object is listed under the Image
if (sNewValue == "OneSteel") then //Let's hide the Acrobat Logo
OneSteel.presence = "visible";
NatSteel.presence = "invisible";
ARC.presence = "invisible";
ActiveSteel.presence = "invisible";
NeumannSteel.presence = "invisible";
Pryme.presence = "invisible";
Wagners.presence = "invisible";
MeshBar.presence = "invisible";
WireIndustries.presence = "invisible";

elseif (sNewValue == "NatSteel") then //Let's hide the Acrobat Pro Box
NatSteel.presence = "visible";
OneSteel.presence = "invisible";
ARC.presence = "invisible";
ActiveSteel.presence = "invisible";
MeshBar.presence = "invisible";
NeumannSteel.presence = "invisible";
Pryme.presence = "invisible";
Wagners.presence = "invisible";
MeshBar.presence = "invisible";
WireIndustries.presence = "invisible";
 
elseif ( sNewValue == "ARC") then //Let's hide the Acrobat 3D Box
ARC.presence = "visible";
OneSteel.presence = "invisible";
NatSteel.presence = "invisible";
ActiveSteel.presence = "invisible";
MeshBar.presence = "invisible";
NeumannSteel.presence = "invisible";
Pryme.presence = "invisible";
Wagners.presence = "invisible";
MeshBar.presence = "invisible";
WireIndustries.presence = "invisible";
 
elseif ( sNewValue == "ActiveSteel") then //Let's hide the Acrobat 3D Box
ActiveSteel.presence = "visible";
OneSteel.presence = "invisible";
NatSteel.presence = "invisible";
ARC.presence = "invisible";
MeshBar.presence = "invisible";
NeumannSteel.presence = "invisible";
Pryme.presence = "invisible";
Wagners.presence = "invisible";
MeshBar.presence = "invisible";
WireIndustries.presence = "invisible";
 
elseif ( sNewValue == "Mesh & Bar") then //Let's hide the Acrobat 3D Box
MeshBar.presence = "invisible";
OneSteel.presence = "invisible";
NatSteel.presence = "invisible";
ARC.presence = "invisible";
ActiveSteel.presence = "invisible";
NeumannSteel.presence = "invisible";
Pryme.presence = "invisible";
Wagners.presence = "invisible";
MeshBar.presence = "visible";
WireIndustries.presence = "invisible";
 
elseif ( sNewValue == "Neumann Steel") then //Let's hide the Acrobat 3D Box
MeshBar.presence = "invisible";
OneSteel.presence = "invisible";
NatSteel.presence = "invisible";
ARC.presence = "invisible";
ActiveSteel.presence = "invisible";
NeumannSteel.presence = "visible";
Pryme.presence = "invisible";
Wagners.presence = "invisible";
MeshBar.presence = "invisible";
WireIndustries.presence = "invisible";
 
elseif ( sNewValue == "Pryme") then //Let's hide the Acrobat 3D Box
MeshBar.presence = "invisible";
OneSteel.presence = "invisible";
NatSteel.presence = "invisible";
ARC.presence = "invisible";
ActiveSteel.presence = "invisible";
NeumannSteel.presence = "invisible";
Pryme.presence = "visible";
Wagners.presence = "invisible";
MeshBar.presence = "invisible";
WireIndustries.presence = "invisible";
 
elseif ( sNewValue == "Wagners Reinforcing") then //Let's hide the Acrobat 3D Box
MeshBar.presence = "invisible";
OneSteel.presence = "invisible";
NatSteel.presence = "invisible";
ARC.presence = "invisible";
ActiveSteel.presence = "invisible";
NeumannSteel.presence = "invisible";
Pryme.presence = "invisible";
Wagners.presence = "visible";
MeshBar.presence = "invisible";
WireIndustries.presence = "invisible";
 
elseif ( sNewValue == "Wire Industries") then //Let's hide the Acrobat 3D Box
MeshBar.presence = "invisible";
OneSteel.presence = "invisible";
NatSteel.presence = "invisible";
ARC.presence = "invisible";
ActiveSteel.presence = "invisible";
NeumannSteel.presence = "invisible";
Pryme.presence = "invisible";
Wagners.presence = "invisible";
MeshBar.presence = "invisible";
WireIndustries.presence = "visible";
 
elseif ( sNewValue == "All Hidden") then // Ok for fun let's hide'em all
OneSteel.presence = "invisible";
NatSteel.presence = "invisible";
ARC.presence = "invisible";
ActiveSteel.presence = "invisible";
MeshBar.presence = "invisible";
NeumannSteel.presence = "invisible";
Pryme.presence = "invisible";
Wagners.presence = "invisible";
MeshBar.presence = "invisible";
WireIndustries.presence = "invisible";
 
endif

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Accepted Answer
You don't need to do anything with a script. In LiveCycle Designer, on the Object tab, set the presence to "Visible(Screen Only)".

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

boourns
Registered: Apr 11 2011
Posts: 10
Somebody already helped sort this problem out for me. Thanks anyway