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

Setting check boxes to be created in app.alert

Participant ,
Jun 01, 2020 Jun 01, 2020

Copy link to clipboard

Copied

There is a button. When the user presses the button, an alert with a description will appear. The alert has a checkbox. I want to make this button itself to disappear when the checkbox is checked by user.

 

Below is the code that doesn't work as expected.

var PINK = this.getField("PINK");
PINK.oMyCheckbox = {cMsg: "Hide this button",
                    bAfterValue: true
                    };
var PINKALERT = app.alert({cMsg: "TEST",
                           cTitle: "TEST", 
                           nIcon: 3,
                           nType: 0,
                           oCheckbox: PINK.oMyCheckbox
                           });
if (PINK.oMyCheckboxf == false){PINK.display = display.hidden;};

There are two questions.

 

  • There is no effect of "bAfterValue: true
  • If set to "PINK.oMyCheckboxf == false", the button will not disappear regardless of whether or not it is checked.
  • If set to "PINK.oMyCheckboxf == true",  the button will disappears regardless of whether or not it is checked.

 

I tried variously, but I don't know how to write it.

 

Thankyou for anybody help.

 

 

TOPICS
Acrobat SDK and JavaScript

Views

287

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

correct answers 1 Correct answer

Community Expert , Jun 01, 2020 Jun 01, 2020

Use this:

var PINK = this.getField("PINK");
PINK.oMyCheckbox = {cMsg: "Hide this button",
                    bAfterValue: true
                    };
var PINKALERT = app.alert({cMsg: "TEST",
                           cTitle: "TEST", 
                           nIcon: 3,
                           nType: 0,
                           oCheckbox: PINK.oMyCheckbox
                           });
if (PINK.oMyCheckbox.bAfterValue == false){PINK.display = display.hidden;};

Likes

Translate

Translate
Community Expert ,
Jun 01, 2020 Jun 01, 2020

Copy link to clipboard

Copied

Use this:

var PINK = this.getField("PINK");
PINK.oMyCheckbox = {cMsg: "Hide this button",
                    bAfterValue: true
                    };
var PINKALERT = app.alert({cMsg: "TEST",
                           cTitle: "TEST", 
                           nIcon: 3,
                           nType: 0,
                           oCheckbox: PINK.oMyCheckbox
                           });
if (PINK.oMyCheckbox.bAfterValue == false){PINK.display = display.hidden;};

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
community guidelines
Participant ,
Jun 03, 2020 Jun 03, 2020

Copy link to clipboard

Copied

LATEST

It is perfect. I didn't notice this code at all. Thank you! I really want to say thank you. And I have to apologize for this late reply. I haven't had time to come back here for the past few days. 

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