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

Pop-Up Box Question

New Here ,
Mar 29, 2016 Mar 29, 2016

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

TOPICS
Acrobat SDK and JavaScript
641
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

correct answers 1 Correct answer

LEGEND , Mar 29, 2016 Mar 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 !==

...
Translate
LEGEND ,
Mar 29, 2016 Mar 29, 2016

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

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 ,
Mar 29, 2016 Mar 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.

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
LEGEND ,
Mar 29, 2016 Mar 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);

}

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 ,
Mar 29, 2016 Mar 29, 2016
LATEST

George, thank you for your help. That worked!

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