Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Make a drop down visible

Avatar

Former Community Member
Hi all

I am fairly new to this and I am sure this has been asked here a million times but here goes!!

I have a drop down list box that has 3 values

i would like another drop down list box to appear ONLY if the user selects a certain value in the 1st drop down

Any help would be greatly appreciated!

Wayne
2 Replies

Avatar

Former Community Member
Hi,



Since I can't add attachments to my post, i'll try to explain how to do this.



Starting off with a blank form, first save it as Adobe Dynamic XML Form (In the "Save As" dialogue). This is very important, if you want to change the interface while the form is being filled out, it has to be saved as dynamic.



Drag two DropDownList objects on to the page. These should be named DropDownList1 and DropDownList2 by default.



Add a few values to both of the drop down lists.



Set DropDownList2 presence to "Hidden".



Add the following script to the change event of the DropDownList1 item:



>if(xfa.event.newText == "MyValue") {



> DropDownList2.presence = "visible";



>}



>else {



> DropDownList2.presence = "hidden";



>}



Change "MyValue" to the value you would like the second drop down list to be visible.



That's about it. You should be able to Preview the form and see the second DropDownList change visibility.



You could also implement this using Subforms and the instancemanager but this method is easier.



A couple of good references for events:



http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_ba...



and



on page 36 of http://partners.adobe.com/public/developer/en/xml/Adobe_XML_Form_Object_Model_Reference.pdf



These documents also contain information on use of the subform instance manager.



Regards

Anthony Jereley



Indigo Pacific

www.indigopacific.com