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

Radio buttons disables other checkboxes

Participant ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

I have four radio buttons in a group. If option one or three are selected I want to disable (and uncheck) a certain checkbox. If option two or four are selected, I want to enable that check box. I'm not sure how to do this.

 

Thanks

 

Jack

 

TOPICS
Edit and convert PDFs , JavaScript , PDF forms

Views

994

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 , Feb 21, 2021 Feb 21, 2021

You didn't say what are names of the fields or name of radio button options so Il go with default and you change names if you need, This is one of the ways you can do it:

In each radio button -> action tab -> Mouse UP event -> Run a JavaScript add this code:

if(event.target.value == "Choice1" || event.target.value == "Choice3"){
this.getField("Check Box1").value = "Off";
this.getField("Check Box1").readonly = true;}
else if(event.target.value == "Choice2" || event.target.value == "Choice4")
this.g
...

Votes

Translate

Translate
Community Expert ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

You didn't say what are names of the fields or name of radio button options so Il go with default and you change names if you need, This is one of the ways you can do it:

In each radio button -> action tab -> Mouse UP event -> Run a JavaScript add this code:

if(event.target.value == "Choice1" || event.target.value == "Choice3"){
this.getField("Check Box1").value = "Off";
this.getField("Check Box1").readonly = true;}
else if(event.target.value == "Choice2" || event.target.value == "Choice4")
this.getField("Check Box1").readonly = false;

Don't forget to change names if needed.

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
Participant ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

Perfect. Thank you.

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 ,
Apr 07, 2022 Apr 07, 2022

Copy link to clipboard

Copied

LATEST

Hello,

I'm trying to adapt this to something similar. I have two radio buttons "Permanent" and "Temporary". If Permanent is selected, I would like Temporary to be disabled. Likewise, If Temporary is selected, I would like Permanent to be disabled. Can you assist with code for this?!  Thanks for help!

Nikki

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