przebudowa systemu
This commit is contained in:
21
static/js/dodaj_wplate.js
Normal file
21
static/js/dodaj_wplate.js
Normal file
@@ -0,0 +1,21 @@
|
||||
(function () {
|
||||
const kwota = document.getElementById('kwota');
|
||||
const opis = document.getElementById('opis');
|
||||
const opisCount = document.getElementById('opisCount');
|
||||
|
||||
document.querySelectorAll('.btn-kwota').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
const val = btn.getAttribute('data-amount');
|
||||
if (val && kwota) {
|
||||
kwota.value = Number(val).toFixed(2);
|
||||
kwota.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (opis && opisCount) {
|
||||
const updateCount = () => opisCount.textContent = opis.value.length.toString();
|
||||
opis.addEventListener('input', updateCount);
|
||||
updateCount();
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user