Copy link to clipboard
Copied
Hi there! I am attempting to code a set of checkboxes to unhide a button when they are checked. It's not a 1:1 correlation, so in my sample that I'm playing with, I have Check1, Check2, Check3, Check4, Check5. If Checks 1, 3, or 5 are checked, I want Button1 to unhide. If all 3 of those checkboxes are unchecked, I want Button1 to hide again. I have been fiddling with the code, and I thought this was the answer, but it's not functioning correctly (it's set as a Mouse Up event) and now I'm stuck. Thanks in advance for your assistance!
var r1 = this.getField("Check1").valueAsString;
var r2 = this.getField("Check3").valueAsString;
var r3 = this.getField("Check5").valueAsString;
if (event.r1 != "Off" || event.r2 != "Off" || event.r3 != "Off") {
this.getField("Button1").display = display.visible ;
} else {
this.getField("Button1").display = display.hidden ;
}
Copy link to clipboard
Copied
#1, first thing to do, Make up a table that shows the relationship between the checkbox states and the button states.
#2. For the case you've described, and the code you've posted.
There is no "event.r1", it's just "r1" as declared at the top of the script.
var r1 = this.getField("Check1").valueAsString;
var r2 = this.getField("Check3").valueAsString;
var r3 = this.getField("Check5").valueAsString;
this.getField("Button1").display = ((r1 != "Off") || (r2 != "Off") || (r3 != "Off"))?display.visible:display.hidden;
Copy link to clipboard
Copied
#1, first thing to do, Make up a table that shows the relationship between the checkbox states and the button states.
#2. For the case you've described, and the code you've posted.
There is no "event.r1", it's just "r1" as declared at the top of the script.
var r1 = this.getField("Check1").valueAsString;
var r2 = this.getField("Check3").valueAsString;
var r3 = this.getField("Check5").valueAsString;
this.getField("Button1").display = ((r1 != "Off") || (r2 != "Off") || (r3 != "Off"))?display.visible:display.hidden;
Copy link to clipboard
Copied
Marvelous, that works beautifully!
And yes, I am definitely building a table because it's actually 12 different checkboxes controlling 7 different buttons and I'll need to keep it straight! (Plus the checkboxes fire off statements in 7 different summary boxes.) Organization for sure!
Thank you so very much for your help!