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

Make radio buttons change other radio buttons

Community Beginner ,
May 20, 2020 May 20, 2020

Copy link to clipboard

Copied

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. 

TOPICS
How to , PDF forms

Views

1.1K

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 Beginner , May 21, 2020 May 21, 2020

Ok guys, thank you for your ideas, I have actually managed to make it work. The core problem is, that there are multiple radio buttons on top of each other and it seems that chrome only makes it possible to click on the top one. By making the only possible anwser for that particular question pre-ticked (setting it as read-only is not necessary in this case) AND rearranging the order of RBs in the field menu, the form now works even in google chrome. 

It is going to be pain to replicate it, as I n

...

Votes

Translate

Translate
Community Expert ,
May 20, 2020 May 20, 2020

Copy link to clipboard

Copied

Report the issue to the developers of the Google Chrome PDF plugin.

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 Expert ,
May 20, 2020 May 20, 2020

Copy link to clipboard

Copied

Hi,

This looks like you need to log an issue with the Google Chrome team for their PDF rendering, if it works as expected in Acrobat, then there is a good chance that it is the implementation that is put in place for Google Chrome.

 

Regards

Malcolm

 

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 ,
May 20, 2020 May 20, 2020

Copy link to clipboard

Copied

Thank you both, I am aware that it is a Chrome issue, but I will try to do that. However I don't really think they will fix it in a reasonable time period.

I am mostly interested to know, if there is a way to make the form behave as intended other then just using the option to Show/Hide fields. If not, I will just have to accept the fact that it won't work in 100 % cases.

Once again, thank you for any reply, it is greatly appreciated.

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 Expert ,
May 20, 2020 May 20, 2020

Copy link to clipboard

Copied

If there's only one choice to select you might as well select it automatically and set the field as read-only.

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 Expert ,
May 20, 2020 May 20, 2020

Copy link to clipboard

Copied

 HI,

 

I had a quick shot at making it a different way, but have been uable to do so, the radio buttons and javascript do not appear to function even close to how they work in Acrobat, it may be we can do it in a different way, although I would be tempted to just guide your users to use Acrobat or Reader, as we could just end up chasing our tails.

 

Regards

Malcolm

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 ,
May 21, 2020 May 21, 2020

Copy link to clipboard

Copied

LATEST

Ok guys, thank you for your ideas, I have actually managed to make it work. The core problem is, that there are multiple radio buttons on top of each other and it seems that chrome only makes it possible to click on the top one. By making the only possible anwser for that particular question pre-ticked (setting it as read-only is not necessary in this case) AND rearranging the order of RBs in the field menu, the form now works even in google chrome. 

It is going to be pain to replicate it, as I need to do the same setup for four more rows of questions, but at least I finally know how to do that. 

 

Thank you all for your support and for pushing me in the right direction. I have submitted this bug to google, so maybe, in the future, they will fix it. But for now, I have a working solution 🙂

 

Kind regards, 

Jakub

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 Expert ,
May 20, 2020 May 20, 2020

Copy link to clipboard

Copied

Setup the form so that if it is not opened in Acrobat or Reader, that it will display a warning to the user. Here's an example of how it can be done:

https://www.pdfscripting.com/public/Lite-Document-Security-Description.cfm

 

Another options is to use the "Download" attribute in the <a>  tag on the webpage where the file is linked. This usually causes the PDF to be downloaded, rather than displayed in the browser.  

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