function check_month(now_month, now_year) { let selected_month = document.getElementById('month').value; let selected_year = document.getElementById('year').value; if (selected_month > now_month && selected_year == now_year || selected_year > now_year) { alert('Невозможно сформировать отчет за будущий период!'); return false; } }