If Checkbox is checked then just uncheck

New Here ,
Jun 03, 2020

Copy link to clipboard

Copied

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, How to, PDF forms

Views

156

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

If Checkbox is checked then just uncheck

New Here ,
Jun 03, 2020

Copy link to clipboard

Copied

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, How to, PDF forms

Views

157

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
Jun 03, 2020 0
Adobe Community Professional ,
Jun 03, 2020

Copy link to clipboard

Copied

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.

 

 

 

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...
Jun 03, 2020 0