Skip to main content
Participant
May 28, 2025
Answered

Check box triggers on check... won't clear on uncheck.

  • May 28, 2025
  • 1 reply
  • 334 views

The following JavaScript works great to autocheck and auto fill when checking CB04. If I make a mistake and check CB04 and need to uncheck it, I need the script to undo the other boxes/fields that were mistakingly filled.

 

Export Value: Yes

Mouse Up - Run a JavaScript

var c04 = this.getField("CB04");
var c06 = this.getField("CB06");
var f03 = this.getField("FE03");  // Example: JOE
var f04 = this.getField("FE04");  // Example: WORKMAN
var f10 = this.getField("FE10");
var f12 = this.getField("FE12");
var f13 = this.getField("FE13");

 

if(c04.isBoxChecked(0,true)){
c06.checkThisBox(0,true);
f10.value = f03.value + " " +f04.value; 
f12.value = "JOHN WORKSALOT";
f13.value = "GEORGE DOESNT";
}

Correct answer try67

After the current code add this:

 

else {

c06.checkThisBox(0,false);
f10.value = "";
f12.value = "";
f13.value = "";

}

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
May 28, 2025

After the current code add this:

 

else {

c06.checkThisBox(0,false);
f10.value = "";
f12.value = "";
f13.value = "";

}

Participant
May 29, 2025

Thank you for the quick response with a 100% correct solution!