Need a script to grey out a portion of the form when box is checked

New Here ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

I'm creating a large categorized checklist form for new employee training.

Sections of the checklist will not apply based on various scenarios.

I'd like to create a checkbox that will grey out a section of the checkist when the trainee determines that this specific section doesn't apply. I'm not deadset on the "check box/greyed section" option, but something that will provide the same visual cue.  I'm including a sample of the form.

Any thoughts or solutions please?

Taya5E88_1-1615755569187.png

 

 

TOPICS
How to

Views

175

Likes

translate

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
Most Valuable Participant ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

Likes

translate

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
New Here ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

Adobe Acrobat Pro DC

Likes

translate

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
Adobe Community Professional ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

Why not keep the section hidden until the appropriate box IS checked to open it?  This is called a conditional form.

 

HTML & jQuery:

https://jsfiddle.net/NancyO/nFPuW/

 

 

 

 

Nancy O'Shea, Adobe Product User & Community Professional
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Likes

translate

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
New Here ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

That was my thought as well.  But, the Trainer wants all sections to be visable until the Trainee is able to determine whether it's applicable or not.  Initially the trainer wanted the trainee to make a Yes/No/NA selection for EVERY single line (over 500), even if the entire section didn't apply.  However, the trainees are pleading for an alternative option, which is what i'm trying to provide.

Likes

translate

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
Adobe Community Professional ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

I think all trainers should be required to take their own tests.  Humans have the attention span of goldfish.  Too much information at once is counterproductive.

 

Good luck!

 

Nancy O'Shea, Adobe Product User & Community Professional
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Likes

translate

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
Adobe Community Professional ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

Nancy, that code doesn't apply to scripting PDF forms in Acrobat. 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

translate

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
Adobe Community Professional ,
Mar 16, 2021 Mar 16, 2021

Copy link to clipboard

Copied

quote

Nancy, that code doesn't apply to scripting PDF forms in Acrobat. 

===========

Yes @Thom Parker,

This question was originally posted to a different board.  It was moved here after I replied 🙂 .

 

To your point, I've never understood why Acrobat doesn't support HTML code.  It would be saner and simpler if it did. But that's another topic.

 

Nancy O'Shea, Adobe Product User & Community Professional
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Likes

translate

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
Most Valuable Participant ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

There's no easy way of doing it. You will need to create an individual field (such as a button or a read-only text field) for each "grayed out" section, hide it, and then show it when you want to block out that area.

I would recommend using one large field to cover the entire section, instead of doing it one line at a time. That would make your work much easier.

Likes

translate

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
Adobe Community Professional ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

I've done this several times on PDF forms. Here's the process

1. Add a rectangle annotation over the area to be grayed out. 

2. Set the color of the rectangle background and opacity to provide the grayed out appearance you want. The rectangle must be "locked" so the user can't move or resize it. 

3. Add code to the MouseUp on the check box to hide/show both the rectangle and any form fields that are under the rectanlge. Form fields cannot be shown at the same time as the rectangle, since they are supposed to be inactive. Also the popup text box for the rectangle needs to be suppressed, so the script should also do this.

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

translate

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
New Here ,
Mar 16, 2021 Mar 16, 2021

Copy link to clipboard

Copied

Thank you Thom! When I'm adding the code to check box properties, should the rectangle annotation come up as an option to show/hide? 

Can you direct me to a current self-help tool for scripting? I feel like i'm a helpless, never-ending spewer of questions. I'm trying to do my own research, but it's crazy time consuming when i'm not sure what/where the best source is.

Likes

translate

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