diff --git a/core/templates/core/log_attendance.html b/core/templates/core/log_attendance.html index d8b9925..83b13b4 100644 --- a/core/templates/core/log_attendance.html +++ b/core/templates/core/log_attendance.html @@ -164,6 +164,13 @@ if (teamSelect) { teamSelect.addEventListener('change', function() { const teamId = this.value; + + // First, deselect ALL workers to clear previous selection + const allCheckboxes = document.querySelectorAll('input[name="workers"]'); + allCheckboxes.forEach(cb => { + cb.checked = false; + }); + if (teamId && teamWorkersMap[teamId]) { const workerIds = teamWorkersMap[teamId]; // Select workers belonging to the team @@ -281,4 +288,4 @@ form.submit(); } -{% endblock %} \ No newline at end of file +{% endblock %}