Expand my Community achievements bar.

Subform(s) visibility

Avatar

Former Community Member
I'm trying to make visible a specific subform based on the value of a radio button. This involves two subforms - stdLayout and customLayout.



Right now, stdLayout is visible when the form opens while customLayout is invisible.



I have this code in place now:



Form initialize:



customLayout.presence = "invisible";



Radio button change:



if (this.rawValue == 1) {

customLayout.presence = "visible";

}else{

customLayout.presence = "invisible";

}



This works fine to make customLayout visible, but I'm at a loss for code to make stdLayout INVISIBLE at the same time. Obviously I only want one visible at any time.



Any help is GREATLY appreciated!



Thanks

Mike
6 Replies

Avatar

Former Community Member
I'm using v8, so answers based on that...



If I understand correctly, wouldnt you just set the stdLayout to invisible at the same time as you make the other visible?



I actually prefer using "hidden" because in a dynamic form, invisible reserves the space, leaving a white space in your form, where hidden removes the form from the object flow.



if (this.rawValue == 1) {

customLayout.presence = "visible";

stdLayout.presence = "hidden";

}else{

customLayout.presence = "hidden";

stdLayout.presence = "visible";

}



Hope that helps.

Avatar

Former Community Member
Thanks Damien.



That worked great. Need to learn more Adobe Javascript here!



Mike

Avatar

Former Community Member
Hello, I just joined the forum today. I am new to this app (v.8) and am learning to create a form. I have a question that looks like it belongs in this thread.



Here's my situation: the company is finally setting up an intranet, and we are slowly moving to .pdf file distribution instead of MS Word. I'm going through an employee status change form done in Word, using document protection and text fields, checkboxes, drop-downs, etc., and I'm re-creating it in LiveCycle.



That part was easy, and I learned the basics of the app, but now I want to make a leap to another level. This form tracks access to various systems and apps, which varies according to the division of the business that the employee is in. When I createds all the checkboxes and drop-downs, etc., I clustered them into subforms.



This thread asks about a radio button value determining subform visibility. I'd like to know if a value in a drop-down can determine visibility. Our hope is that when HR chooses a value in the Division drop-down, then the form will only display the systems and apps that a person in that division would normally have access to.



Can this be done? and where are you entering that code you sampled here?



Thanks,



- A

Avatar

Former Community Member
Don't see why not. The code is attached to the CHANGE event.

Good luck.



Mike

Avatar

Former Community Member
Thanks! I'm studying up on it now.



...keeping the F1 key warm...

Avatar

Level 1

Did you get a response to this?  I'm trying to do exactly the same thing.