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

Assistance with app.alert oCheckbox Parameter

New Here ,
Aug 18, 2018 Aug 18, 2018

Copy link to clipboard

Copied

I'm attempting to nest an if statement to display a validation alert and a secondary informational alert which works fine, but continually pops-up with each field calculation if true. I'm now trying to incorporate the oCheckbox parameter after reading THIS article; however, although it displays properly and though my hideWarning variable is accurately resetting to "true" once the oCheckbox is checked, it does not stop popping-up. Any ideas what I'm doing incorrectly? Any assistance is very much appreciated!

Here's a simplified version of what I'm attempting:

if (!isNaN(event.value) && event.value < 10) { // Test for field value is a number and less than 10

   app.alert("Value must be greater than 10",1,0); // Validation alert

   var hideWarning = false; // initialization

    // Display Alert if hideWarning is false

    if(hideWarning == false) { // Test to see if variable hideWarning is false

        var oCk = {bInitialValue:false, bAfterValue:true}; // Set checkbox state

        // Secondary Alert that I'd like to hide if the user checks the don't show box

        app.alert({cMsg:"This is a message",nIcon:1,nType:0,cTitle:"This is a message title",oCheckbox:oCk});

        // Set hideWarning state for next calculation

      hideWarning = oCk.bAfterValue;

    }

}

TOPICS
Acrobat SDK and JavaScript

Views

398

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
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 18, 2018 Aug 18, 2018

Remove the line:

var hideWarning = false;

Put this line at document level.

Votes

Translate

Translate
Community Expert ,
Aug 18, 2018 Aug 18, 2018

Copy link to clipboard

Copied

Remove the line:

var hideWarning = false;

Put this line at document level.

Votes

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
community guidelines
New Here ,
Aug 19, 2018 Aug 19, 2018

Copy link to clipboard

Copied

LATEST

That did it! Thank you sir!

Votes

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
community guidelines