Praxissofttware/views/invoice-select.js

17 lines
488 B
JavaScript

/**
* public/js/invoice-select.js
* Ersetzt onchange="this.form.submit()" in Rechnungs-Filtern (CSP-sicher)
*/
document.addEventListener('DOMContentLoaded', function () {
const ids = ['cancelledYear', 'creditYear', 'paidYear', 'paidQuarter'];
ids.forEach(function (id) {
const el = document.getElementById(id);
if (el) {
el.addEventListener('change', function () {
const form = this.closest('form');
if (form) form.submit();
});
}
});
});