Skip to main content
Participant
Nov 15, 2017 2:44 PM UTC
Question

I want to populate a drop down list based on check boxes/radio buttons value, help?

I have a form which has 3 check box or radio button. I want to be able to show/hide elements of a drop down menu list based on the select check box

i'm clueless, help would be really apppreciated

This topic is closed to new replies. Start a new post to keep the conversation going.

8 replies

Thom Parker
Community Expert
Community Expert
Nov 15, 2017 5:43 PM UTC

if you dropdown field is named "MyList", then this code will set the items in the dropdown to A,B,C

this.getField("MyList").setItems(["A","B","C"]);

Put a copy of this code in the mouse up for each radio button. Changing the Field name to the correct name, and each of the item lists to the items you want set by that radio button.

Using check boxes requires a more complicated strategy. Stick with Radio buttons if you can

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Bernd Alheit
Community Expert
Community Expert
Nov 15, 2017 3:40 PM UTC

You can delete and insert items. You can't show/hide items.

Translate
Participant
Nov 15, 2017 3:42 PM UTC

ok, i want to change the values of a dropdown. so either delete/insert or show/hide at the end the result will be the same.

Translate
Bernd Alheit
Community Expert
Community Expert
Nov 15, 2017 3:47 PM UTC

Look at the Acrobat JavaScript Reference.

Translate
Inspiring
Nov 15, 2017 3:06 PM UTC
Participant
Nov 15, 2017 3:10 PM UTC

Hi, not exactly what i'm looking for. I want to show/hide different elements of a drop down list based on multiple check box selections

Translate