Skip to main content
Participant
April 18, 2025
Question

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

  • April 18, 2025
  • 2 replies
  • 288 views

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?

2 replies

try67
Community Expert
Community Expert
April 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;
Nesa Nurani
Community Expert
Community Expert
April 18, 2025

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

Participant
April 18, 2025

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