Copy link to clipboard
Copied
Hello!
I was wondering if it is possible to create a pdf document that has yes/no/n/a questions that you can click on to select your answer? Say for instance, Question 1 is...Is the sun hot? then there are the options of yes no and n/a. Can whoever is filling out the form, click the answer Yes and it highlights it to a color to show that was their answer? Any help would be greatly appreciated. Thank you in advance!
Copy link to clipboard
Copied
If you wish for user to click on words, you could use buttons instead of text fields and set button label to be answer.
Example:
Lets say you create 3 buttons (we will name them "B1", "B2" and "B3") .
1. Select 'Prepare form' tool and right click on button and select properties, go to 'Appearance' and set border color to 'No color'.
2. To set answer as label, Select 'Prepare form' tool and right click on button and select properties, go to 'Options' tab and select 'Layout' to be 'Label only' and where it say 'Label' input your answer (Yes, No, or N/A).
3. Now we will set script so when button is clicked it will change border color to red.
To put script, go to button properties -> Actions tab and select 'Mouse UP' then from dropdown pick 'Run a JavaScript' and click on 'Add' now paste script inside and click 'Ok'.
For button "B1" script:
event.target.borderColor = (color.equal(color.transparent, event.target.borderColor)) ? color.red : color.transparent;
this.getField("B2").borderColor = color.transparent;
this.getField("B3").borderColor = color.transparent;
For button "B2" script:
event.target.borderColor = (color.equal(color.transparent, event.target.borderColor)) ? color.red : color.transparent;
this.getField("B1").borderColor = color.transparent;
this.getField("B3").borderColor = color.transparent;
For button "B3" script:
event.target.borderColor = (color.equal(color.transparent, event.target.borderColor)) ? color.red : color.transparent;
this.getField("B1").borderColor = color.transparent;
this.getField("B2").borderColor = color.transparent;
If you wish to change fill color instead of border color, just replace 'borderColor' with 'fillColor' in scripts.
Here is working example:
https://drive.google.com/uc?export=download&id=1WXG7C_KRM2skcflVA5J_6SXbn2FrPaZZ
Copy link to clipboard
Copied
This will work, but there's a problem with such an approach, namely that buttons don't have values. Say that later on you want to automatically grade this questionnaire or export the answers given to an Excel spreadsheet so they can be further analyzed, etc. You can't do it because the border color of a button is not a value and won't be exported. You will have to write a custom-made script for exporting those selections, which is not ideal.
I recommend not trying to re-invent the wheel, if it's not needed. Just use a group of check-boxes or radio-buttons with static text labels next to them. If you really want the text itself to be clickable then add buttons over those texts that assign a value to those input fields. That way you could export the values later on much more easily, if needed.
Copy link to clipboard
Copied
I wont need to export this to any sort of other format, so i plan on trying this out this week. Thank you for the suggestion! I appreciate the help!
Copy link to clipboard
Copied
Thank you for taking the time out to reply with this suggestion! Im going to try it out! You rock!
Copy link to clipboard
Copied
@Nesa Nurani's suggestion is good.
Note: You'll need to use Adobe Acrobat PRO DC to have the form tools. Acrobat Standard and Reader do not have those tools.
Copy link to clipboard
Copied
Acrobat DC Standard has also the form tools!
Copy link to clipboard
Copied
Thank you everyone!! I appreciate everyones feedback!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more