• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Community Beginner ,
Dec 17, 2017 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.

TOPICS
Acrobat SDK and JavaScript

Views

402

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
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 17, 2017 Dec 17, 2017

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 rad

...

Votes

Translate

Translate
Community Expert ,
Dec 17, 2017 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

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
community guidelines
Community Beginner ,
Dec 17, 2017 Dec 17, 2017

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines