Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Feb 26, 2018 Feb 26, 2018

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
925
Translate
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
Community Expert ,
Feb 26, 2018 Feb 26, 2018

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.

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

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

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

Translate
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
Community Expert ,
Feb 27, 2018 Feb 27, 2018
LATEST

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

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

Translate
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