diff --git a/drcr/templates/journal/journal_edit_transaction.html b/drcr/templates/journal/journal_edit_transaction.html index a989a5c..c37ac3d 100644 --- a/drcr/templates/journal/journal_edit_transaction.html +++ b/drcr/templates/journal/journal_edit_transaction.html @@ -97,7 +97,7 @@ {{ 'Edit' if transaction and transaction.id else 'New' }} transaction -
+ @@ -220,19 +220,14 @@ } function changeAmount(el) { - let amountInputs = document.querySelectorAll('input[name="amount"]'); + let amountInputs = document.querySelectorAll('#edit-transaction-form input[name="amount"]'); if (amountInputs.length === 2) { - // Get other input - let otherInput; for (inp of amountInputs) { if (inp !== el) { - otherInput = inp; - break; + // Update other input with amount + inp.value = el.value; } } - - // Update other input with amount - otherInput.value = el.value; } }