Skip to main content
Inspiring
June 2, 2020
Answered

Setting check boxes to be created in app.alert

  • June 2, 2020
  • 1 reply
  • 730 views

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.

 

 

This topic has been closed for replies.
Correct answer Bernd Alheit

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

1 reply

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
June 2, 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;};
Inspiring
June 3, 2020

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.