Skip to main content
Participant
May 10, 2017 6:29 PM UTC
Question

Multiple check boxes making an image visible

Hello,

I am trying to create a form where if ALL checkboxes are checked an image appears, but if anything less than all of them are a different image appear, can anyone help me with that code?

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

try67
Community Expert
Community Expert
May 21, 2017 10:08 AM UTC

Put the image as the icon of a button field and then create a hidden text field with this custom calculation code:

var checkboxes = ["CheckBox1", "CheckBox2", "CheckBox3"]; // etc.

var showImage = true;

for (var i in checkboxes) {

    if (this.getField(checkboxes).value=="Off") {

          showImage = false;

          break;

    }

}

this.getField("ImageButton").display = showImage ? display.visible : display.hidden;

Translate