Clear Form Button will not reset fill color after check box is cleared

New Here ,
Feb 26, 2018

Copy link to clipboard

Copied

First off, thank you to anyone who takes the time to read this and attempt to help me.

I made a PDF form with check boxes. I used a mouse up Java Script so that when the check box is checked aka "Yes" the fill and font are a specific color:

Check Box Java.jpg

I then made a Clear Form button which when clicked does clear all the check boxes but it leaves the form boxes with the fill color of when the box is checked instead of going back to unfilled. The only way to then clear the form box fill is to check the box and then uncheck. I have over 100 check boxes. To clear the check box fill one by one would be a pain in the arse. Any thoughts or suggestions?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

223

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

Clear Form Button will not reset fill color after check box is cleared

New Here ,
Feb 26, 2018

Copy link to clipboard

Copied

First off, thank you to anyone who takes the time to read this and attempt to help me.

I made a PDF form with check boxes. I used a mouse up Java Script so that when the check box is checked aka "Yes" the fill and font are a specific color:

Check Box Java.jpg

I then made a Clear Form button which when clicked does clear all the check boxes but it leaves the form boxes with the fill color of when the box is checked instead of going back to unfilled. The only way to then clear the form box fill is to check the box and then uncheck. I have over 100 check boxes. To clear the check box fill one by one would be a pain in the arse. Any thoughts or suggestions?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

224

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
Feb 26, 2018 0
Adobe Community Professional ,
Feb 26, 2018

Copy link to clipboard

Copied

Resetting a form only affects the field values. The colors or any other property you choose to set in a script has to be reset with a script. Just add a script action to the Clear button.

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...
Feb 26, 2018 0
New Here ,
Feb 27, 2018

Copy link to clipboard

Copied

Thom, thank you. I am having trouble finding a JavaScript to add to the Clear Button that will accomplish this. Any examples?

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...
Feb 27, 2018 0
try67 LATEST
Most Valuable Participant ,
Feb 27, 2018

Copy link to clipboard

Copied

You can use exactly the same code as you used to set the color originally:

this.getField("Check Box5").fillColor = color.transparent;

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...
Feb 27, 2018 0