Avatar

Correct answer by
Community Advisor

Hello @bryceh57660644 

If you to store the checkbox value and treat it as a boolean then here is the code

 

HTML

<input type="checkbox" id="agree" label="agree">

JS

if(document.getElementById('agree').checked){
 document.controller.setValue('/ctx/vars/CHECKBOX_VARIABLE',"true");
 }  else{
  document.controller.setValue('/ctx/vars/CHECKBOX_VARIABLE',"false");
 }

 

Let me know if that helps

View solution in original post