Bug 24300: (follow-up) Set minimum for amount input

Add a 'min' attribute for validation of the amount field in the payout
modal so that negative amounts cannot be submitted.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Martin Renvoize 2021-03-16 16:06:36 +00:00 committed by Jonathan Druart
parent 9a92554c6b
commit 1f32b62d1c

View file

@ -365,7 +365,7 @@
$('#payoutline').val(accountline);
var amount = button.data('amount') * -1;
$("#paid + span").replaceWith(amount);
$("#amount").attr({ "value": amount, "max": amount });
$("#amount").attr({ "value": amount, "max": amount, "min": 0 });
$("#amount, #payout_transaction_type").focus();
});