Skip to main content
Participant
June 16, 2017
Question

Custom script for yes and no answers

  • June 16, 2017
  • 2 replies
  • 551 views

Hi,

I am creating a form that asks a series of yes and no safety related questions. They are all worded so the operator should be answering yes.

I would like to know if there is a way to create a box at the bottom that would populate once all fields are completed. If all answers are yes the box would change to green and display 'SAFE TO FLY'. If any of the answers are no then the box would change to red and display 'DO NOT FLY'.

Any ideas?? Is this even possible?

Thanks,

This topic has been closed for replies.

2 replies

Karl Heinz  Kremer
Community Expert
Community Expert
June 16, 2017

... and here is some information about using colors in Acrobat's JavaScript: https://acrobatusers.com/tutorials/using-colors-acrobat-javascript

Joel Geraci
Community Expert
Community Expert
June 16, 2017

Yes - It's possible. In your final field calculation script, you can use the field isBoxChecked method to examine the other fields and then set the value of the final field and it's color based on the result.

Documentation for isBoxChecked is here

Acrobat DC SDK Documentation

Participant
June 16, 2017

Im using a drop down list though not a radio button for yes and no. I already have them conditionally coloured depending on their answer. Would the isBoxchecked work on a drop down list?

And how would I format it to say if all are 'Yes' then green and display text SAFE TO FLY, else if one is no then red and 'DO NOT FLY'

Joel Geraci
Community Expert
Community Expert
June 16, 2017

Did you look at the documentation link I sent? It explains what field types isBoxchecked will work with.