I have made progress! I have made a custom js file with this code:
$(document).ready(function () {
if ($('#form_xxx').length) { // Replace XXX with your form ID
$(document).change(function () {
var timer = document.querySelectorAll('input[type="checkbox"]:checked').length
$('#element_49').val(timer)
});
}
});
This will count checkboxes. Works fine when I only use one checkbox field. How can I modify code to only count checkboxes from one specific field? (if several exists in same form).