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

Hidding a text field

frustrateduser
Registered: Jun 3 2009
Posts: 7

I have a check box that I want to use to hide a text field if checked. I am using the following script, but it is not work.

On the Click event.

if (CheckBox1.rawValue == 1) {TextField2.presence = "hidden";

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Little correction needed!

if (CheckBox1.rawValue == "1")
{
TextField2.presence = "hidden";
}

And the script editor has to be set to JavaScript, not FormCalc!

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

frustrateduser
Registered: Jun 3 2009
Posts: 7
I figured out how to hide the field when needed.

how can I hide the text field at opening of the PDF, and not show it until I check the checkbox.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Select the textfield in the design view, choose the preffered visiblity of it in the object tab.
Then place a script like posted before into the click event of your check box for example.

Still no luck? Check the help of LiveCycle Designer (F1) to get detailed help and examples!

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

frustrateduser
Registered: Jun 3 2009
Posts: 7
Ok, this is what I did.

I made the textfield as invisible.

It goes away on the PDF.

Next I put in the script to make the field visible and it does not work.


If I put the field back to visible, and change the script to make it invisible, that works.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
OK,

open your form with Acrobat and press ctrl + J to open the JavaScript Debugger-
Mark the checkbox to fire your script and look for an error message in the console.

Which one is it?

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

frustrateduser
Registered: Jun 3 2009
Posts: 7
I figured out the issue. I had to do a Save As, dynamic document.

Thanks for your help.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Well, that's of course a reason for the probs you expected.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs