Expand my Community achievements bar.

Attach action to radio button

Avatar

Former Community Member
Hi, I'm a total newbie with this app, but am very familiar w/ Acrobat. I need to build a form that has 3 radio buttons (mutually exclusive). Depending on which radio button is selected, I need drop down lists to become hidden/visibile.



In Acrobat Pro, I attacched an action to the radio button that 'on mouse down', show DropList1, and hide DropList2 and DropList 3. It worked fine on a dummy form I made in Acrobat.



I hope the question makes sense, any suggestions?



Thanks
4 Replies

Avatar

Level 4
Jeff, this same strategy will work with Designer Documents. The difference is in the particulars of the XFA Object Model (the actual functions and properties)



The following code is uesed to make subforms hidden/visible



xfa.form.form1.Pg1.Subform1.presence = "visible";

xfa.form.form1.Pg1.Subform2.presence = "invisible";



The word "hidden" can also be used, but don't do it. It forces the removal of the form fields from the document layout, whereas "invisible" just hides them from view.



Thom Parker

WindJack Solutions


www.windjack.com

Avatar

Former Community Member
Thanks for the help Thom. I gave this a shot, and didn't have luck. Ok, so in Designer, I created a radio button group on my main form. I created subforms (Subform1, Subform2). In these subforms, are drop down lists. I would like these drop down lists to appear depending on which radio button is clicked.



So I select the radio button, and on the script editor window I put in:



xfa.form.form1.Subform1.presence = "visible";



Is my language still 'FormCalc'? I did all this, and it didn't work. I didn't get errors, buut nothing became visible/invisible. Do I have the basics down? I have never used this app before, I'm helping someone else out. I have done this in Acrobat Pro, but this seems MUCH different than that.



Thanks,

Jeff

Avatar

Former Community Member
Here's a simple sample. You can see the script on the RadioButtonList object in the change event.



Chris

Adobe Enterprise Developer Support

Avatar

Level 4
Jeff,

The code you've shown is JavaScript. It should work just fine as long as the scripting window is set for JavaScript. One way to see if there were any errors is to look at the JavaScript Console Window when this file is opened in Acrobat. To open the console use the menu item "Advanced>JavaScript>Debugger" or press "Ctrl+J"



Thom Parker

WindJack Solutions


www.windjack.com