Skip to content

Commit

Permalink
warn on negative quantity for sending fairs
Browse files Browse the repository at this point in the history
  • Loading branch information
bum2 committed Jun 17, 2019
1 parent f5e0842 commit 1a5c97d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion faircoin/templates/faircoin/faircoin_account.html
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,11 @@ <h3>
jQuery.validator.addMethod("quantity",
function(value, element) {
var isValidQuantity = /^\d{0,6}(\.\d{0,4})?$/.test(value);
if isValidQuantity and parseFloat(value) <= 0:
isValidQuantity = false;
return this.optional(element) || isValidQuantity;
},
"Please enter a number less than 1000000 with no more than 4 decimal places"
"Please enter a positive number less than 1000000 with no more than 4 decimal places"
);

$.validator.addClassRules("quantity", { quantity: true });
Expand Down

0 comments on commit 1a5c97d

Please sign in to comment.