Also in create form.

This commit is contained in:
James Cole
2023-01-15 07:21:51 +01:00
parent 7111aec101
commit 7e6ce7c3e8
2 changed files with 21 additions and 0 deletions

View File

@@ -30,4 +30,21 @@ $(document).ready(function () {
}
);
}
// change the 'ffInput_opening_balance' text based on the
// selection of the direction.
$("#ffInput_liability_direction").change(triggerDirection);
triggerDirection();
});
function triggerDirection() {
let obj = $("#ffInput_liability_direction");
let direction = obj.val();
console.log('Direction is now ' + direction);
if('credit' === direction) {
$('label[for="ffInput_opening_balance"]').text(iAmOwed);
}
if('debit' === direction) {
$('label[for="ffInput_opening_balance"]').text(iOwe);
}
}