diff --git a/front/src/main/resources/static/ui/commonUtil.js b/front/src/main/resources/static/ui/commonUtil.js index 7e60c2b7..6506dcfe 100644 --- a/front/src/main/resources/static/ui/commonUtil.js +++ b/front/src/main/resources/static/ui/commonUtil.js @@ -246,10 +246,15 @@ kri.form.error = function(errorList){ } } -kri.form.maxlength = function(object){ - if (object.value.length > object.maxLength) { - object.value = object.value.slice(0, object.maxLength); - } -} - +$(function() { + $('body').on('input', 'input[type="number"]', function() { + let $el = $(this); + if ($el.val().length > $el.attr('maxlength')) { + $el.val($el.val().slice(0, $el.attr('maxlength'))); + } + if ($el.attr('inputmode') === 'numeric') { + $el.val($el.val().replace('.', '')); + } + }) +}) \ No newline at end of file diff --git a/front/src/main/resources/templates/info/bank/inputForm.html b/front/src/main/resources/templates/info/bank/inputForm.html index 525cde1a..ae59b020 100644 --- a/front/src/main/resources/templates/info/bank/inputForm.html +++ b/front/src/main/resources/templates/info/bank/inputForm.html @@ -121,7 +121,7 @@
+ inputmode="decimal" pattern="[0-9]*" maxlength="10" >