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

Hiding floating subforms

Lea1337
Registered: Jul 14 2009
Posts: 64

I am kind of a newbie in LiveCycle, so my questions may very well be completely stupid :)

I have created a form that contains several subforms (call them subform 1, 2, 3 and 4 for simplicity). I want subform 1 to be visible at all times, while the other ones are hidden until the user makes a choice from a drop-down list in subform 1.

When the user has made a choice, I want for instance subform 3 to become visible, and to be placed directly beneath subform 1. All the other subforms should still be hidden.

What I have accomplished so far, is to make the different subforms visible when the user makes a choice. But my problem is that the subforms do not float, they don't move up directly under subform 1.

I use JavaScript to hide/show the subforms based on the choice made by the user (change event in the drop-down list). If I try hiding and showing the different subforms manually while in Design View, they float perfectly (i.e. I make subform 2 and 4 visible while 3 is hidden, then 4 places itself directly beneath 2)

Any ideas as to what I am doing wrong?

My Product Information:
LiveCycle Designer, Windows
suewhitehead
Registered: Jun 3 2008
Posts: 232
Try putting have Subforms 1,2,3, and 4 inside a subform that is set to Flow, from top to bottom. You can put them into a new subform by right-clicking on them in the Hierarchy pane, go to Wrap in Subform. Then make this new subform Flowed from top to bottom. This subform is the one that will control whether the fields and subforms contained within it are positioned or flowed. I think right now you have your 4 subforms inside a positioned subform.
Lea1337
Registered: Jul 14 2009
Posts: 64
I do have all the subforms (1,2, 3 and 4) inside a main subform that is flowed. But what I had also done, was place the contents of the various subforms into another subform, like so:

main subform: flowed
- subform 1: positioned
- subform 2: flowed
-- subform 2.1: positioned (and here is all the content of subform 2)
- subform 3: flowed
--subform 3.1: positioned (and here is all the content of subform 3)
etc.

I did this to try and avoid messing up the placement of my content; when I have all the content directly under subform 2 (which is flowed), all my carefully placed form elements are placed under each other, and I don't have any opportunity to move them.

But, I tried removing all my positioned subforms (2.1, 3.1 and so on..) and placing all my content directly under my flowed subforms (2, 3 and 4), and also keeping the parent subform flowed. This did not help, my subform 3 is still displayed way down on the page when I make this choice in the drop-down menu (in Preview).

Again, if I change presence on subform 3 from hidden to visible in Design View, it is placed nicely right beneath subform 1.

I find this a bit strange :-p
jonom
Registered: Jan 31 2008
Posts: 133
Check to make sure you don't have large top/bottom margins set on the subforms - bottom margin on the first subform, top margins on your hidden subforms.

Also, I don't think you need that many subforms - your subforms 2.1 and 3.1 don't need to be in their own flowed subforms as you already have your main subform set to flowed. I don't think this is causing the problem, but I like to keep things simple.
Lea1337
Registered: Jul 14 2009
Posts: 64
I have been checking and re-checking the form and the JavaScript code to find out what could be wrong. Seeing as I am far from an expert in JavaScript I figured that would be the most likely root of the error. And I was right! I had been staring myself blind from the totally obvoius, I had set presence to invisible instead of hidden. Kind of embarrassed now :-p

But when it comes to the subforms 2.1, 3.1 and so forth, I concluded that they have to stay put inside their respective subforms, complicated as it might be. Because I want the subforms to float, but I want the content of the subforms to stay in their place (where I have placed them). Therefore I must have a flowed subform first, and then a positioned subform inside it. At least that is the only solution I could find to solve this predicament.

Thanks for the feedback, it always helps to have other perspectives! :-)
exstock5
Registered: Oct 12 2010
Posts: 2
I am also new to using LiveCycle v8.2. I would like something similiar to the form Lea1337 create, but not dependent on a dropdown box. For example, there are subforms 1-6, I would like #2 not display until a selection (approve or reject) is made in subform #6.

How would that be done. Also can you post the javascript (or direct me to some sample code)that was used in your form?