             specificLeaveField.removeAttribute('required');
                }
            }

        }

        // Add an event listener to the specific leave field to handle its value changes
        specificLeaveField.addEventListener('input', function() {
            if (specificLeaveField.value.trim()) {
                // If there's a value, remove the required attribute
                specificLeaveField.removeAttribute('required');
            } else {
                // If no value, set the require