Skip to main content
mikeyman
Participant
June 3, 2020
Question

If Checkbox is checked then just uncheck

  • June 3, 2020
  • 1 reply
  • 525 views

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);
}

 

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
June 3, 2020

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 PDFScriptingUse the Acrobat JavaScript Reference early and often