It may be a personal preference, but I don't have much trust in the isBoxChecked() method. If it is just a single checkbox, using the value of the field works, and is more reliable (IMHO). For that, you'd add the following code to the MouseUp event of the checkbox:
if (event.target.value != "Off") {
// box is checked
this.getField("teamset2").display = display.visible ;
this.getField("member2").display = display.visible ;
} else {
// box is unchecked
this.getField("teamset2").display = display.hidden ;
this.getField("member2").display = display.hidden ;
}
Note that's for Acroforms. If you happen to have XFA, the syntax is different.
If there are various options for the return value (meaning multiple checkboxes being grouped with same field name but different return values, those values can be evaluated using the switch… statement.
If you are using hierarchical field names for the fields controlled via the checkbox, you can use the group name, and toggle the display property for the whole group in one single line.
Hope this can help.
Max Wyss.