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

skipping a radio button group based on answer to previous radio button

New Here ,
Apr 18, 2025 Apr 18, 2025

I have several yes/no radio button groups on a form I've created. If the answer to question one is "yes" then question two is skipped, and you move on to question three. I've tried the suggestions I've found for adding javascript, but I just can't seem to get it right. Any help?

TOPICS
Create PDFs , JavaScript
89
Translate
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 Expert ,
Apr 18, 2025 Apr 18, 2025

What do you want to do, skip when tabbing, or make them read only? What script did you try so far?

Translate
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
New Here ,
Apr 18, 2025 Apr 18, 2025
LATEST

When clicking on the "yes" radio button in group 1, I want to be lock group 2 so nothing can be selected.  Right now, I have: 

this.getfield("group2.choice1").readonly=true;
this.getfield("group2.choice2").readoly=true

Translate
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 Expert ,
Apr 18, 2025 Apr 18, 2025

Place the following code (adjust the field names and values as needed) as the custom calculation script of a (hidden) text field in your file:

 

var radio2 = this.getField("Radio2");
if (this.getField("Radio1").valueAsString=="yes") {
	radio2.readonly = true;
	radio2.value = "Off";
} else radio2.readonly = false;
Translate
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