Expand my Community achievements bar.

SOLVED

Text Disappearing

Avatar

Level 3

I created a form in LiveCycle and when I go to test it out in PDF form after saving the document and then opening it back up some of the text is gone.  One part in particular, I have a drop down and based on the selection the static text box is populated and every thing looks good, but when I save, close and reopen the PDF the static text is missing.  What am I doing wrong? Please help, thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

The exit event is a good one when working with dropdowns.

In the first instance let's say that in the Object > Binding palettte you do not have the Specify values ticked. If the dropdown is Yes (show the object) and No (hide the object), then the following JavaScript in the exit event should work:

if (this.rawValue == "Yes") {

     TextObject.presence = "visible";

}

else {

     TextObject.presence = "hidden";

}

If you have Specified values in the Object > Binding palette, then let's say Yes=1 and No=0, the script would look like:

if (this.rawValue == 1) {

     TextObject.presence = "visible";

}

else {

     TextObject.presence = "hidden";

}

You will need to make sure that you are referencing the text object correctly, in particular if it is separated by subforms from the dropdown.

Does that help?

Niall

View solution in original post

8 Replies

Avatar

Level 10

Hi,

I suspect that you need to go into the File > Form Properties > Defaults tab and for the Preserve Script Changes, set the radio button to Automatic.

Preserve script changes.png

This will preserve the changes to the text object.

Hope that helps,

Niall

Avatar

Level 3

It didn't seem to work.  I guess what I'm trying to do and not sure it's possible, but I'm trying to use javascript in the layout:ready event in a flowable layout.  Can this be done correctly?  My presence scripts isn't working when the document is saved and then reopened where there is flowable content.

Avatar

Level 10

Hi,

The layout:ready event may not be the best one to choose. What is driving the presence of the object? Is it a choice that a user makes?

If I know that I could advise a better event to place the script.

Niall

Avatar

Level 3

Yes, it's usually a drop down that drives the presence scripts based on user choice.  I also tried the exit event but I can't get that to work either.

Avatar

Correct answer by
Level 10

Hi,

The exit event is a good one when working with dropdowns.

In the first instance let's say that in the Object > Binding palettte you do not have the Specify values ticked. If the dropdown is Yes (show the object) and No (hide the object), then the following JavaScript in the exit event should work:

if (this.rawValue == "Yes") {

     TextObject.presence = "visible";

}

else {

     TextObject.presence = "hidden";

}

If you have Specified values in the Object > Binding palette, then let's say Yes=1 and No=0, the script would look like:

if (this.rawValue == 1) {

     TextObject.presence = "visible";

}

else {

     TextObject.presence = "hidden";

}

You will need to make sure that you are referencing the text object correctly, in particular if it is separated by subforms from the dropdown.

Does that help?

Niall

Avatar

Level 3

okay so this works but after saving the document, closing it and then opening it up again objects are missing.  So say like the drop down "yes" is selected and the text box enter name and enter address appear and the user puts in the information.  The document is then saved and closed out.  When its reopened the name and address text boxes are gone, but the drop down "yes" is still selected. Also when the user reselects "yes" the name and address boxes reappear but with the information that was previously entered.  Hope this makes sense.  Am I missing something?

Avatar

Level 3

My bad operator error on my part.  I got it to work now.  Thank you so much for your help!!  I can go home feeling complete now LOL!

Avatar

Level 10

Hi,

Check is there other script that is controlling the presence of the name and address textfields. Maybe some legacy script in the layout:ready event, the docReady event or the initialise event?

I suspect that this is what the problem is. Now that you have the dropdown exit script working, you don't need any other script.

Hope that works,

Niall

PS - Great