Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

How to maintain the action in a saved pdf

Avatar

Former Community Member
Hi,



I have the following script in the Change event of dropdownlistbox:



Subform1.presence = "hidden";



The Subform1 element hides from the form, but after I save the pdf file and then reopen it, it's still visible. How can I maintain the action that was performed on the element so the file remembers it when it is saved?



Thanks
3 Replies

Avatar

Former Community Member
Use the layout ready event. Add the code that you use to hide the subform except wrap it in an if statement that checks the value of the list box.



Stone.

Avatar

Former Community Member
Thanks for the response.



That doesn't do it for some reason.



In the change event I have:



switch(xfa.event.newText) {

case 'one':

Subform1.presence = "hidden";

Subform2.presence = "visible";

break;

case 'two':

Subform1.presence = "visible";

Subform2.presence = "hidden";

break;

}



The I went to the layout:ready event of the dropdown and I added:



if (DropDownList1.rawvalue == 'one' ) then



Subform1.presence = "hidden";

Subform2.presence = "visible";



elseif (DropDownList1.rawvalue == 'two' ) then

Subform1.presence = "visible";

Subform2.presence = "hidden";



endif



I use the form, change it, save it but both forms are visible.



I know it has to be easier than that. Do you know what I'm doing wrong?



Thanks

Avatar

Former Community Member
What is the value of DropDownList1.rawvalue when the layout ready event fires?



If the value is null, you will need to access the incoming data.

If the value is one, or two, then you have an error in your logic.



Stone.