diff --git a/wwwroot/js/shared.js b/wwwroot/js/shared.js index 5eda87b..af264d6 100644 --- a/wwwroot/js/shared.js +++ b/wwwroot/js/shared.js @@ -178,8 +178,8 @@ function uploadFileAsync(event) { }); } function isValidMoney(input) { - const euRegex = /^\$?(?=\(.*\)|[^()]*$)\(?\d{1,3}(\.?\d{3})?(,\d{1,3}?)?\)?$/; - const usRegex = /^\$?(?=\(.*\)|[^()]*$)\(?\d{1,3}(,?\d{3})?(\.\d{1,3}?)?\)?$/; + const euRegex = /^\$?(?=\(.*\)|[^()]*$)\(?\d{1,3}((\.\d{3}){0,8}|(\d{3}){0,8})(,\d{1,3}?)?\)?$/; + const usRegex = /^\$?(?=\(.*\)|[^()]*$)\(?\d{1,3}((,\d{3}){0,8}|(\d{3}){0,8})(\.\d{1,3}?)?\)?$/; return (euRegex.test(input) || usRegex.test(input)); } function initDatePicker(input, futureOnly) { @@ -1053,4 +1053,4 @@ function bindModalInputChanges(modalName) { $(`#${modalName} select, #${modalName} input[type='checkbox']`).off('input').on('input', function (e) { $(e.currentTarget).attr('data-changed', true); }); -} \ No newline at end of file +}