Assistance with app.alert oCheckbox Parameter

New Here ,
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;

    }

}

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

Remove the line:

var hideWarning = false;

Put this line at document level.

TOPICS
Acrobat SDK and JavaScript, Macintosh

Views

128

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

Assistance with app.alert oCheckbox Parameter

New Here ,
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;

    }

}

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

Remove the line:

var hideWarning = false;

Put this line at document level.

TOPICS
Acrobat SDK and JavaScript, Macintosh

Views

129

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
Aug 18, 2018 0
Adobe Community Professional ,
Aug 18, 2018

Copy link to clipboard

Copied

Remove the line:

var hideWarning = false;

Put this line at document level.

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...
Aug 18, 2018 1
N8-K LATEST
New Here ,
Aug 19, 2018

Copy link to clipboard

Copied

That did it! Thank you sir!

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...
Aug 19, 2018 0