Skip to main content
Participant
January 25, 2022
Question

Acrobat clickable text fields?

  • January 25, 2022
  • 3 replies
  • 789 views

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!

This topic has been closed for replies.

3 replies

McM808Author
Participant
January 26, 2022

Thank you everyone!! I appreciate everyones feedback!

Bevi Chagnon - PubCom.com
Legend
January 26, 2022

@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.

 

|    Bevi Chagnon   |  Designer, Trainer, & Technologist for Accessible Documents ||    PubCom |    Classes & Books for Accessible InDesign, PDFs & MS Office |
Bernd Alheit
Community Expert
Community Expert
January 26, 2022

Acrobat DC Standard has also the form tools!

Nesa Nurani
Community Expert
Community Expert
January 26, 2022

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 

try67
Community Expert
Community Expert
January 26, 2022

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.