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

If Checkbox is checked then just uncheck

New Here ,
Jun 03, 2020 Jun 03, 2020

Basically, I want an undo.

If I check the box, a bunch of stuff happens.  But then I realize I checked the wrong box and want to uncheck it and return to the default state.  All help is welcome. Here's what I've tried:

//Whoops I didn't mean to check that box.  I want to uncheck it. (doesn't work)
if (this.getField("splyAD700").value!="On") {
this.getField("splyAD700").checkThisBox(0,event.target.value = "Off");
} else {
//This is what should happen when I check the box. (it works)
this.getField("splyAD700").checkThisBox(0,event.target.value = "On");
app.launchURL("https://www.somesite.com", true);
}

 

TOPICS
Acrobat SDK and JavaScript
481
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 ,
Jun 03, 2020 Jun 03, 2020
LATEST

So first, did you set the export value of the checkbox to "On", because the default value is "Yes".

 

Is this code in the MouseUp Action for the checkbox being checked?

Is "splyAD700" a different checkbox than the one being checked?

If so then what is the export value of "splyAD700"?

 

Your code needs a great deal of help, but I need to know the answers to the questions above before I can provide a fix.

 

 

 

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