I wrote the following javascript to attempt to set the value of a check box to either ON or OFF depending on the status of the check box. However the value I am assigning when the checkbox is NOT checked is not being passed. If I select the box I see "Its On" being passed.
Here is the JavaScript i wrote
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
const checkbox = document.getElementById("WEEK1")
checkbox.addEventListener('click', (event) => {
if (event.currentTarget.checked) {
document.getElementById("WEEK1").value = "Its ON";
} else {
document.getElementById("WEEK1").value = "Its OFF";
}
})
</SCRIPT>
Here is the code for my checkbox
response.write("<TD>")
Response.Write("<INPUT type=checkbox id=WEEK1 name=" & idPOS & ">")
response.write("</TD>")