[FO] kri.form.maxlength 방식 변경

This commit is contained in:
김현주
2025-06-26 15:53:30 +09:00
parent f1eb2cd3f9
commit dea45f467f
11 changed files with 51 additions and 46 deletions

View File

@@ -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('.', ''));
}
})
})