Custom script for yes and no answers

New Here ,
Jun 16, 2017

Copy link to clipboard

Copied

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,

TOPICS
Acrobat SDK and JavaScript, Macintosh, Windows

Views

156

Likes

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

Custom script for yes and no answers

New Here ,
Jun 16, 2017

Copy link to clipboard

Copied

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,

TOPICS
Acrobat SDK and JavaScript, Macintosh, Windows

Views

157

Likes

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
Jun 16, 2017 0
Adobe Community Professional ,
Jun 16, 2017

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jun 16, 2017 0
New Here ,
Jun 16, 2017

Copy link to clipboard

Copied

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'

Likes

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
Reply
Loading...
Jun 16, 2017 0
Adobe Community Professional ,
Jun 16, 2017

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jun 16, 2017 0
New Here ,
Jun 16, 2017

Copy link to clipboard

Copied

Yes I did,

"The 0-based index of an individual radio button or check box widget" Of which a drop down list is neither.

Likes

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
Reply
Loading...
Jun 16, 2017 0
Adobe Community Professional ,
Jun 16, 2017

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jun 16, 2017 1