Make radio buttons change other radio buttons
- May 20, 2020
- 4 replies
- 1450 views
Hello,
I've been trying to work this one out for a few days now, but I always find a problem with my solution.
I have a form with four questions, you can always anwser Yes/No to those questions. I have decided to do this with radio buttons, no problem there. However, I also need to set up this:
If I anwser Yes to the first question, you can freely choose Yes/No in other three questions.
If I anwser No to the first question, you can only choose No in the other three questions.
To make it even more complicated, I also need to set up this:
If I anwser Yes in the second question, you can only choose Yes in the third question (the fourth is not affected)
If I anwser No in the second question, you can freely choose Yes/No in the third question (the fourth is not affected)
I have found a solution, that works perfectly in Adobe Acrobat by modifying visibility of respective radio buttons (described below), this one might actually help someone. However the problem appears, when I open the PDF in Google Chrome. I attach (or at least I hope so) the form, so that you can have a look at it.
Current solution working in Adobe Acrobat
I have created several RB groups for every possibility:
Q1 - only one group containing anwser Yes and No
Q2 - two groups - one with Yes and No, the other one only with No
Q3 - three groups - Yes+No; Yes; No
Q4 - two goups - Yes+No; No
For individual RB in Q1 and Q2 is set up an action that displays / hides RB groups, so that the form works well. I won't describe the whole setup, just setup for Q1 for an idea:
Clicking on Yes:
Hides: Groups with just the anwser No in Q2 - Q4; Group just Yes in Q3
Shows: Groups with both Yes and No in Q2-Q4
Clicking on No:
Hides: Groups with both Yes and No in Q2-Q4; Group with just Yes in Q3
Shows: Groups with only No in Q2-Q4
As I said, it works just fine in Adobe Acrobat (no matter the version) and you don't need any javascript, but the problem comes in Google Chrome. Because this setup only hides those RB, Chrome still makes the hidden RB somehow clickable and thus you cannot select the right RB.
It is getting really frustrating and honestly I don't know what else I can do about it to make it work. I have tried using dropdown lists, however that makes it a bit problematic when you just print the form without filling it.
Any help would be very much appreciated.
