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

Subforms collapses when the form is saved and reopened

Uashbjo
Registered: Mar 3 2009
Posts: 18
Answered

Hi,

I have a form with a couple of checkbox that make hidden subforms become visible if checked (all the subforms are hidden by default). Everything works fine for the person that fills the form.

My problem is that everytime the form is saved and then opened by somebody else, the checkboxes are still checked but all the subforms collapsed to the initial view. So the person that receives the filled form as to uncheck and check again the checkboxes to make the subforms reappear, which can be pretty long if there's a lot of checkboxes checked.

Is there any way that the subforms stay visible after the form is filled and "saved as"?

I looked around the other threads treating this problem but it doesn't give any answers.

Thanks!

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

I know this behavior, too. I had alot of trouble because of this.
It happnes if the visibility is controlled by a script in the checkbox event.
I solved the problem by placing the script to an event of the controlled subform.

Form1.Page3.Body.Abs1.Subform2::ready:layout - (JavaScript, client)if (Form.Page3.Body.Abs1.CheckBox2.rawValue == "1"){this.presence = "visible";}else{this.presence = "invisible";}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Uashbjo
Registered: Mar 3 2009
Posts: 18
Hi, thanks for the answer, but I'm not quite sure I get it. This is the script for my checkbox in the event click:

if (Titre_Logiciel.rawValue == true)
Logiciel_sousform.presence = "visible";
else
Logiciel_sousform.presence = "hidden";

So I cut it and paste it in the subform it controls (Logiciel_sousform) in the event ready:layout?
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Right, tut the script into the subforms layout ready event.
This will cause the subform to check itself on every reopen of the form, if it should be hidden or visible, depending of the value of the checkbox.

if (Titre_Logiciel.rawValue == "1"){this.presence = "visible";}else{this.presence = "hidden";}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Uashbjo
Registered: Mar 3 2009
Posts: 18
Thank you for your answer. It now works. I'll have to modify a couple of subforms(I noticed that the subform that is controlled by the checkbox as to be in the same subform for this to work), but everything should be fine.

The only thing is that instead of cutting the script from the click event of the checkbox I left it there. When I took it out, the checkbox wouldn't work anymore.

Thank you again, you solved a problem that caused me a headache for a while now.
Tech264
Registered: Apr 4 2008
Posts: 111
Thank goodness for this forum. I was just about to post this exact same question even getting ready to attach the form and the answer worked for me as well. Because I have check boxes within a table I had to use this code.

form1.Page2_2::ready:layout - (JavaScript, client)

if (form1.Page1.Table4.Row3.MaritalFamily.MaritalAdd.rawValue == 1)
{this.presence = "visible"
}
else
{this.presence = "hidden"
}
Tech264
Registered: Apr 4 2008
Posts: 111
I'm still working with this form that has similar features except somehow my check boxes disappear when I try unclicking the box. Any ideas why my boxes disappear?

Don't know if it's because I'm working with tables but I have a column in a table that's called New Goals and those boxes don't disappear. Here's the code I'm using for that column.
---------------
if (form1.Page1.Table4.Row1.NewGoal1.NewGoal1.rawValue == 1)
{Goal1.presence = "visible"
}
else
{Goal1.presence = "hidden"
}
if (form1.Page1.Table4.Row1.NewGoal1.NewGoal1.rawValue == 1)
{Goal1.Table5.Row1.Goal1.Goal = "1"
}

-----------

Then in another column in the same table which is labeled Previous Goal Revised. I have this code:

if (form1.Page1.Table4.Row1.Rgoal1.RevisedGoal1.rawValue == 1)
{RevisedGoal1.presence = "visible"
}
else
{RevisedGoal1.presence = "hidden"
}
if (form1.Page1.Table4.Row1.Rgoal1.RevisedGoal1.rawValue == 1)
{RVGOAL1.Table5.Row1.Goal1.Goal = "1"
}

-----------

I'm attaching the form so you can see the problem I'm having.

http://www.narcofreedom.com/forms/keep.pdf

If you click on Page 1 below where in the column says "Previous Goal Revised" It's suppose to unhide a page called RevisedGoal1.

Also in that same table in the column that says "New Goal" that also unhides a page called Goal1.


Thank you!