i have put this code in the footer but it doesnt seems to work
after checking the box , the other box doesnt get unchecked
<script type = "text/javascript" >
if (typeof mainF == 'undefined') {
const mainF = function(event) {
var checkbox1 = document.getElementById('InsertRecordhandover')
var checkbox2 = document.getElementById('InsertRecordapproved')
var textfield1= document.getElementById('InsertRecordprocess_notes')
if (checkbox1.checked == true) {
checkbox2.checked = false;
textfield1.value= " ";
} else if (checkbox1.checked == false) {
checkbox2.checked = true;
}
if (checkbox2.checked == false) {
checkbox1.checked = true;
} else if (checkbox2.checked == true) {
checkbox1.checked = false;
}
checkbox1.addEventListener('change', function() {
if (checkbox1.checked == true) {
checkbox2.checked = false;
textfield1.value= " ";
} else if (checkbox1.checked == false) {
checkbox2.checked = true;
}
});
checkbox2.addEventListener('change', function() {
if (checkbox2.checked == false) {
checkbox1.checked = true;
} else if (checkbox2.checked == true) {
checkbox1.checked = false;
}
})
document.removeEventListener('DataPageReady', mainF)
}
document.addEventListener('DataPageReady', mainF)
}
</script>