Skip to main content
Participant
November 15, 2017
Question

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

  • November 15, 2017
  • 3 replies
  • 1288 views

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 has been closed for replies.

3 replies

Thom Parker
Community Expert
Community Expert
November 15, 2017

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

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Bernd Alheit
Community Expert
Community Expert
November 15, 2017

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

Participant
November 15, 2017

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.

Bernd Alheit
Community Expert
Community Expert
November 15, 2017

Look at the Acrobat JavaScript Reference.

Inspiring
November 15, 2017
Participant
November 15, 2017

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