Expand my Community achievements bar.

Move the subforms depending on user action

Avatar

Former Community Member
I have a form with three radio buttons and four subforms. Three of the subforms are invisible when the form loads. Depending on which radio button is clicked a subform appears.



I am able to do so. My problem is that the subforms are placed on top of each other in the form like:



Subform 1: appears when radio button 1 is clicked

Subform 2: appears when radio button 2 is clicked

Subform 3: appears when radio button 3 is clicked

Subform 4: Always appear on the form



Now when my from loads, there is a huge white space because of three subforms, which are currently invisible. How do I remove that???
15 Replies

Avatar

Former Community Member
The way you describe it in your post makes it sound like Subform2's y position is Subform1's bottom coordinate, is that right?



If that's the case, is it possible that you couldn't place each subform on top of the other because every time you tried to do so, Designer would think you wanted to place one subform
into the other?



It sounds like you would have to select each subform (using the Hierarchy palette may be easier for this) and, using the Layout inspector, set their dimensions and positions to be identical. You could also use the Alignment toolbar to achieve this.



This would result in all 3 subforms whose visibility are toggled by the radio buttons to appear at the same place.



Does that help?



Stefan

Adobe Systems

Avatar

Former Community Member
Thanks for your response..I did try that...using the exact same y co-ordinates for all 3 subforms...and that does work fine..but still i have a 4th subform which has to appear on the form always. So rather than having white space of 3 subforms , I have space for (almost)one subform.

How do I make that 4th subform to move down when any of the three subforms appear??/



Thanks

Marleen

Avatar

Former Community Member
It sounds like you need to make the container of all these subforms flowed so that when the "optional" ones appear, they push the "constant" one down. You would then use the instance manager of each optional subform to toggle their visibility.



I've attached a sample of what I'm trying to describe. Check it out to see if it's what you're looking for.



Stefan

Adobe Systems

Avatar

Former Community Member
Marleen L wrote:

> I have a form with three radio buttons and four subforms. Three of the subforms are invisible when the form loads. Depending on which radio button is clicked a subform appears.

>

> I am able to do so. My problem is that the subforms are placed on top of each other in the form like:

>

> Subform 1: appears when radio button 1 is clicked

> Subform 2: appears when radio button 2 is clicked

> Subform 3: appears when radio button 3 is clicked

> Subform 4: Always appear on the form

>

> Now when my from loads, there is a huge white space because of three subforms, which are currently invisible. How do I remove that???



Marleen,

Try setting your visibility of your subforms to hidden instead of

invisible. If they are hidden, they will not take up any space in the

form, causing the 4th subform to shift upward. This will only work if

your 4 subforms are wrapped inside of another flow subform. Your form

structure should look something like this:



Subform 0: Visible, Flow content (Top to Bottom)

Subform 1: Hidden

Subform 2: Hidden

Subform 3: Hidden

Subform 4: Visible



Let me know how this works.



Justin Klei

Cardinal Solutions Group

http://www.cardinalsolutions.com/Solutions/adobe.asp

Avatar

Former Community Member
Thanks so much chris..this works great...



i still have a problem though...When I click on the radio button, the corresponding subform shows but the button doesnt get checked...why is this happening???



Justin, using your way, i am able to move the subform4 up, but unable to show subform 1,2 or 3 on click of radio button. Subform.presence="visible" is not working if I make them hidden.But anyways that got solved using chris' method.



Thanks

Marleen

Avatar

Former Community Member
this is weird...i have tried many things, including new radio buttons from tghe library palette..but the radio buttons do not get selected on click...the dot appears just for a second and disappears...Any Idea why this is happening and how to resolve this??



Note: They are functioning properly..the code executes on click..it just doesnt show as clicked



Thanks

Marleen

Avatar

Former Community Member
That's very strange -- especially since the radio buttons still aren't working after creating new ones from the Library. I've seen a few other threads about objects which stop working for no reason. Replacing them with new ones from the Library always seems to solve the problem.



Is it possible that there's more than one radio button in the group with the same value?



Stefan

Adobe Systems

Avatar

Former Community Member
I have thoroughly checked..there arent any two Radio buttons with same value..I did found out one thing though...if i remove the code..radio buttons get checked normally...



My apologies for addressing you as Chris earlier...Thanks Stefan for the sample form..It is exactly what i was looking for...



Thanks

Avatar

Former Community Member
That's OK. I noticed I hadn't signed my post as I usually do.



Is it possible that your code is somehow inadvertently changing the value of the radio button and/or group? Seems like this could be the case if the group works as expected once you remove the code.



How about my sample? Do the radio buttons on it work properly?



Stefan

Adobe Systems

Avatar

Former Community Member
I am using you code only...A couple things i noticed...



1.radio buttons in you form aren't getting clicked either.



2. In your code, If I choose radio button 1, subform 1 is displayed. If I choose Radio Button2, subform2 is displayed. But if i choose Radio button3, subform2 is displayed again, and the earlier subform2 also exists.

this problem is removed by removing the code from each individual Radio button and putting it with the radio button list using if..else statements {if (this.rawValue == 1)}.

I have Acrobat professional 7.0 on my system.

Any idea if this is causing any trouble??

Avatar

Former Community Member
Are you saying you have Acrobat 7.0 as opposed to the updated Acrobat 7.0.7 on your system? This could be the point where our systems differ because my sample works as one would expect with the code on the radio buttons themselves and the radio buttons remain checked.



Could you try updating to 7.0.7 or do you need 7.0 for a specific reason?



If you stick with the code on the radio button group's Change event, make sure you don't have a typo in one of your IF statements where you've typed a single equality (=) sign instead of a double equality sign (==) for the comparison. A single equality sign will assign the value to the group instead of compare it but will also evaluate to "true" as long as the resulting value of "this.rawValue" is always something other than zero (0) (which may explain why your radio buttons don't stay checked but the right subform appears anyway).



Stefan

Adobe Systems

Avatar

Former Community Member
I have checked all == are in places.

I guess it is because of reader 7.0.7 and acrobat 7.0 prof reasons only. I cannot upgrade to reader 7.0.7 myself beacuse of security reasons but when my tech support tried installing it , i got a message that a superior adobe writer and distiller are already on my system.

What is the difference between adobe reader and adobe acrobat professional. Can i have reader 7.0.7 and acrobat 7.0 professional??

Avatar

Former Community Member
For the most part, as far as PDF forms go, Reader and Acrobat Pro are similar but Acrobat Pro does permit some advanced features like data import and data connections which, without LC Forms or Reader Extensions, can't be accomplished in Reader.



Are you able to upgrade to Acrobat Pro 7.0.7 (it's a free update from Adobe)? The point being to test your form and/or my sample with either Reader or Acrobat Pro 7.0.7.



As far as being able to have Reader 7.0.7 and Acrobat Pro 7.0 on the same system, I wouldn't know for sure and I wouldn't want to mislead you with a wrong answer.



Stefan

Adobe Systems

Avatar

Former Community Member
Thanks so much Stefan...I did check this on reader 7.0.7 and the radio buttons do work great...your sample form as well as mine..



I have one question though..can we do that if user clicks on Radio button for the first time, it gets checked(Like it does)...but if user clicks on the same radio button again, it gets unchecked (Like check boxes)



I have put in the request for upgrade and should have it in few days..(Network security makes it even tougher..I can get it free from adobe but not install it :-( )



Thanks for all your help..