Expand my Community achievements bar.

"check all" checkbox?

Avatar

Level 1

is there a way to create a "check all" box? so that when checked it propogates to referenced boxes?

1 Reply

Avatar

Level 10

Hi,

If you had all the checkbox controls in a subform and they had the standard zero for off and one for on then you could use the following JavaScript code;

var fields = Subform1.resolveNodes("#field[*]")

for (var i=0; i<fields.length; i++)

{

    var field = fields.item(i);

    if (field.ui.oneOfChild.className == "checkButton")

    {

        field.rawValue = 1;

    }

}

This loops though all the fields of Subform1 and if the field is a checkbox (or checkButton) then sets the value to 1 (or on).

Bruce