Have a radio button checked based on a selection of an item from a dropdown list

Community Beginner ,
Dec 17, 2017

Copy link to clipboard

Copied

Hi,

I have a dropdown list and a group of radio buttons on my form.

I need that the appropriate radio button should get automatically checked based on the selection of an item from a dropdown list.

For example,

If Item 1 is selected than radiobtn1 should be checked and if Item 2 is selected than radioBtn2 should get checked.

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

This article covers the basic principle of changing a form field from a dropdown and will get you started:

https://acrobatusers.com/tutorials/change_another_field

However, the example is changing a set of text fields from the combo selection.  Radio buttons are a little different, but not much.  A radio button is turned on when the value of the Radio Button Group is set to the export value of a specific button.

So if you make the export values for the list the same as the export values for the radio buttons, then you can use this code in the Keystroke Script for the combobox

if(!event.willCommit)

     this.getField("RadioGroup").value = event.changeEx;

The "RadioGroup" needs to be changed to the name of your radio button group

TOPICS
Acrobat SDK and JavaScript

Views

104

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Have a radio button checked based on a selection of an item from a dropdown list

Community Beginner ,
Dec 17, 2017

Copy link to clipboard

Copied

Hi,

I have a dropdown list and a group of radio buttons on my form.

I need that the appropriate radio button should get automatically checked based on the selection of an item from a dropdown list.

For example,

If Item 1 is selected than radiobtn1 should be checked and if Item 2 is selected than radioBtn2 should get checked.

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

This article covers the basic principle of changing a form field from a dropdown and will get you started:

https://acrobatusers.com/tutorials/change_another_field

However, the example is changing a set of text fields from the combo selection.  Radio buttons are a little different, but not much.  A radio button is turned on when the value of the Radio Button Group is set to the export value of a specific button.

So if you make the export values for the list the same as the export values for the radio buttons, then you can use this code in the Keystroke Script for the combobox

if(!event.willCommit)

     this.getField("RadioGroup").value = event.changeEx;

The "RadioGroup" needs to be changed to the name of your radio button group

TOPICS
Acrobat SDK and JavaScript

Views

105

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 17, 2017 0
Adobe Community Professional ,
Dec 17, 2017

Copy link to clipboard

Copied

This article covers the basic principle of changing a form field from a dropdown and will get you started:

https://acrobatusers.com/tutorials/change_another_field

However, the example is changing a set of text fields from the combo selection.  Radio buttons are a little different, but not much.  A radio button is turned on when the value of the Radio Button Group is set to the export value of a specific button.

So if you make the export values for the list the same as the export values for the radio buttons, then you can use this code in the Keystroke Script for the combobox

if(!event.willCommit)

     this.getField("RadioGroup").value = event.changeEx;

The "RadioGroup" needs to be changed to the name of your radio button group

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 17, 2017 0
Community Beginner ,
Dec 17, 2017

Copy link to clipboard

Copied

Was very helpful.

It took me a while, though, to figure out how to make the export values of the Radio buttons the same as the export values of the list. But got it in the end.

Thanks

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 17, 2017 1