Skip to main content
caraz6557281
Participant
March 29, 2016
Answered

Pop-Up Box Question

  • March 29, 2016
  • 1 reply
  • 690 views

I created the following Javascript in Adobe Pro to have a pop-up box appear when a box is checked. However, when I uncheck that box the pop-up appears again. Is there a way to disable that pop-up box if I want to uncheck that box?

if (this.getField("AtoA").value !="Off")

app.alert("The A2A contains all of this information in a different format. Are you sure this report is also needed?", 3);

This topic has been closed for replies.
Correct answer George_Johnson

So it's the Mouse Up script of the CommercialAuto check box, right? It seems that you also want to see whether it is selected or not, something like:

// If this check box is selected, display a popup if the AtoA check box is selected

if (event.target.value !== "Off") {

    if (this.getField("AtoA").value !="Off") {

        app.alert("The A2A contains all of this information in a different format. Are you sure this report is also needed?", 3);

    }

}

This can be simplified to:

if (event.target.value !== "Off" && getField("AtoA").value !== "Off") {

    app.alert("The A2A contains all of this information in a different format. Are you sure this report is also needed?", 3);

}

1 reply

Inspiring
March 29, 2016

Where did you place the code exactly, and could it be in more than one location?

caraz6557281
Participant
March 29, 2016

If the AtoA box is checked, and someone tries to check this CommercialAuto checkbox, the popup will appear.  The code is placed in the CommercialAuto checkbox.

George_JohnsonCorrect answer
Inspiring
March 29, 2016

So it's the Mouse Up script of the CommercialAuto check box, right? It seems that you also want to see whether it is selected or not, something like:

// If this check box is selected, display a popup if the AtoA check box is selected

if (event.target.value !== "Off") {

    if (this.getField("AtoA").value !="Off") {

        app.alert("The A2A contains all of this information in a different format. Are you sure this report is also needed?", 3);

    }

}

This can be simplified to:

if (event.target.value !== "Off" && getField("AtoA").value !== "Off") {

    app.alert("The A2A contains all of this information in a different format. Are you sure this report is also needed?", 3);

}