Hi Isaac,
Plz review and attempt sth like this sample:
as we have with any type of fields you like for user input :
sth.html
<input type="checkbox" />
<button> Click On </button>
<script>
const checkbox = document.querySelector('input[type=checkbox]');
const button = document.querySelector('button');
checkbox.onchange = () => {
if (checkbox.checked) {
button.onclick = () => { alert('Alert sth of user input. ');
};
}
};
</script>
If you asign any id of each input tag or type, you can map to db, that base on your declare and define.