Expand my Community achievements bar.

Drop Down List Function Statement needed

Avatar

Former Community Member
Hello People,



Happy Thursday for Starters. Its Almost Friday. :-)



I have a drop down list, I would like to have a different subform populate with each value on the subform. example



1 = Bob Subform

2 = Holly Subform

And so on.



I have 22 values in the list and each need to populate a different subform. can Someone help me out real fast? I'd like to clean this up for the long weekend.



Thanks a bunch
5 Replies

Avatar

Former Community Member
Not sure I understand 100%:

"I have a drop down list, I would like to have a different subform populate with each value on the subform. "



but... the quickest, not most efficient way, is:



In the exit or change event of your drop down box



xfa.form.FORM1.dropDownList::exit - (JavaScript, client)



if (this.rawValue == "1")

{

xfa.form.FORM1.Subform1. ... = "what ever";

}

if (this.rawValue == "2")

{

xfa.form.FORM1.Subform2. ... = "what ever2";

}



hope this helps...?

Avatar

Former Community Member
You will have to create all 22 subforms that could possibly be displayed. Mark them all as hidden. Then when the user makes a selection in the drop down, on the exit event of your dropdown your code woudl look something like this:



xfa.resolveNode("xfa.form.form1.Page1." + DropDown.rawValue (appropriate subform name)".presence = "visible"



Make sure you set up your form as a fowed form. If the user decides to select a different name after the 1st one is displayed, then you can hide any subforms that are showing or simply make the appropriate subform visiable as well. It will be added after the last one.

Avatar

Former Community Member
Worked out well, Thank you very much for helping me out so fast, Please enjoy the long weekend and Holiday. I'm sure we will chat again. :-)