Setting check boxes to be created in app.alert

Participant ,
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.

 

 

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

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;};
TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

256

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

Setting check boxes to be created in app.alert

Participant ,
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.

 

 

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

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;};
TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

257

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
Jun 01, 2020 0
Adobe Community Professional ,
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
Reply
Loading...
Jun 01, 2020 0
Participant ,
Jun 03, 2020

Copy link to clipboard

Copied

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
Reply
Loading...
Jun 03, 2020 0