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

View File

@@ -121,7 +121,7 @@
</div>
<div class="input-field">
<input type="number" id="count" placeholder="수량을 입력해 주세요" name="count" class="limitDecimalLength" min="1" max="9999999999"
inputmode="decimal" pattern="[0-9]*" maxlength="10" oninput="kri.form.maxlength(this)">
inputmode="decimal" pattern="[0-9]*" maxlength="10" >
</div>
<ul class="guide-info">
<li>예 : 2, 2.5</li>
@@ -182,7 +182,7 @@
<div class="input-field type-price">
<input type="number" id="price" name="price" placeholder="금액을 입력해 주세요"
class="limitAmountLength" min="1" max="9999999999"
maxlength="10" inputmode="numeric" pattern="[0-9]*" oninput="kri.form.maxlength(this)">
maxlength="10" inputmode="numeric" pattern="[0-9]*" >
<span class="input-field-txt">원</span>
</div>
<ul class="input-info" style="display:none">

View File

@@ -84,7 +84,7 @@
</div>
<div class="input-field">
<input type="number" id="count" placeholder="수량을 입력해 주세요" name="count" class="limitDecimalLength" min="1" max="9999999999"
inputmode="decimal" pattern="[0-9]*" maxlength="10" oninput="kri.form.maxlength(this)">
inputmode="decimal" pattern="[0-9]*" maxlength="10" >
</div>
<ul class="guide-info">
<li>예 : 2, 2.5</li>
@@ -147,7 +147,7 @@
<div class="input-field type-price">
<input type="number" id="price" placeholder="금액을 입력해 주세요" name="price" min="1" max="9999999999"
class="limitAmountLength"
maxlength="10" inputmode="numeric" pattern="[0-9]*" oninput="kri.form.maxlength(this)">
maxlength="10" inputmode="numeric" pattern="[0-9]*" >
<span class="input-field-txt">원</span>
</div>
<ul class="input-info" style="display:none">

View File

@@ -63,7 +63,7 @@
<div class="input-field">
<input type="number" id="availableArea" placeholder="가능 면적을 입력해 주세요"
name="availableArea" class="limitDecimalLength" min="1" max="9999999999"
inputmode="decimal" pattern="[0-9]*" maxlength="10" oninput="kri.form.maxlength(this)">
inputmode="decimal" pattern="[0-9]*" maxlength="10" >
</div>
</div>
</section>
@@ -97,7 +97,7 @@
<div class="input-field">
<input type="number" id="landArea" placeholder="작업 면적을 입력해 주세요"
name="landArea" class="limitDecimalLength" min="1" max="9999999999"
inputmode="decimal" pattern="[0-9]*" maxlength="10" oninput="kri.form.maxlength(this)">
inputmode="decimal" pattern="[0-9]*" maxlength="10" >
</div>
<ul class="guide-info">
<li>예 : 180, 6</li>
@@ -118,7 +118,7 @@
<div class="input-field">
<input type="number" id="mainYield" placeholder="수확량을 입력해 주세요"
name="mainYield" class="limitDecimalLength" min="1" max="9999999999"
inputmode="decimal" pattern="[0-9]*" maxlength="10" oninput="kri.form.maxlength(this)">
inputmode="decimal" pattern="[0-9]*" maxlength="10" >
</div>
</div>
@@ -177,7 +177,7 @@
<div class="input-field">
<input type="number" id="mainSaleAmount" placeholder="판매량을 입력해 주세요"
name="mainSaleAmount" class="limitDecimalLength" min="1" max="9999999999"
inputmode="decimal" pattern="[0-9]*" maxlength="10" oninput="kri.form.maxlength(this)">
inputmode="decimal" pattern="[0-9]*" maxlength="10" >
</div>
</div>
@@ -236,7 +236,7 @@
<div class="input-field">
<input type="number" id="subYield" placeholder="수확량을 입력해 주세요"
name="subYield" class="limitDecimalLength" min="1" max="9999999999"
inputmode="decimal" pattern="[0-9]*" maxlength="10" oninput="kri.form.maxlength(this)">
inputmode="decimal" pattern="[0-9]*" maxlength="10" >
</div>
</div>
@@ -295,7 +295,7 @@
<div class="input-field">
<input type="number" id="subSaleAmount" placeholder="판매량을 입력해 주세요"
name="subSaleAmount" class="limitDecimalLength" min="1" max="9999999999"
inputmode="decimal" pattern="[0-9]*" maxlength="10" oninput="kri.form.maxlength(this)">
inputmode="decimal" pattern="[0-9]*" maxlength="10" >
</div>
</div>

View File

@@ -86,13 +86,13 @@
<div class="component-input">
<div class="input-field">
<input type="number" th:field="*{tel2}" min="0" max="9999"
maxlength="4" inputmode="numeric" pattern="[0-9]*" oninput="kri.form.maxlength(this)"/>
maxlength="4" inputmode="numeric" pattern="[0-9]*" />
</div>
</div>
<div class="component-input">
<div class="input-field">
<input type="number" th:field="*{tel3}" min="0" max="9999"
maxlength="4" inputmode="numeric" pattern="[0-9]*" oninput="kri.form.maxlength(this)"/>
maxlength="4" inputmode="numeric" pattern="[0-9]*" />
</div>
</div>
</div>
@@ -114,13 +114,13 @@
<div class="component-input">
<div class="input-field">
<input type="number" id="temp_input_0006" th:field="*{phone2}" min="0" max="9999"
maxlength="4" inputmode="numeric" pattern="[0-9]*" oninput="kri.form.maxlength(this)">
maxlength="4" inputmode="numeric" pattern="[0-9]*" >
</div>
</div>
<div class="component-input">
<div class="input-field">
<input type="number" id="temp_input_0007" th:field="*{phone3}" min="0" max="9999"
maxlength="4" inputmode="numeric" pattern="[0-9]*" oninput="kri.form.maxlength(this)">
maxlength="4" inputmode="numeric" pattern="[0-9]*" >
</div>
</div>
</div>

View File

@@ -80,7 +80,7 @@
</div>
<div class="input-field">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="quantity" name="quantity" min="1" max="9999999999"
th:value="${detail.quantity}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="수량을 입력해 주세요">
th:value="${detail.quantity}" maxlength="10" placeholder="수량을 입력해 주세요">
</div>
<ul class="guide-info">
<li>예 : 2, 2.5</li>
@@ -135,7 +135,7 @@
</div>
<div class="input-field type-price">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="price" name="price" min="1" max="9999999999"
th:value="${detail.price}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="금액을 입력해 주세요">
th:value="${detail.price}" maxlength="10" placeholder="금액을 입력해 주세요">
<span class="input-field-txt">원</span>
</div>
<ul class="guide-info">
@@ -152,7 +152,7 @@
</div>
<div class="input-field type-price">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="estimatedValue" name="estimatedValue" min="1" max="9999999999"
th:value="${detail.estimatedValue}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="금액을 입력해 주세요">
th:value="${detail.estimatedValue}" maxlength="10" placeholder="금액을 입력해 주세요">
<span class="input-field-txt">원</span>
</div>
<ul class="guide-info">

View File

@@ -67,7 +67,7 @@
</div>
<div class="input-field">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="quantity" name="quantity" min="1" max="9999999999"
th:value="${detail.quantity}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="수량을 입력해 주세요">
th:value="${detail.quantity}" maxlength="10" placeholder="수량을 입력해 주세요">
</div>
<ul class="guide-info">
<li>예 : 2, 2.5</li>
@@ -122,7 +122,7 @@
</div>
<div class="input-field type-price">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="estimatedValue" name="estimatedValue" min="1" max="9999999999"
th:value="${detail.estimatedValue}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="금액을 입력해 주세요">
th:value="${detail.estimatedValue}" maxlength="10" placeholder="금액을 입력해 주세요">
<span class="input-field-txt">원</span>
</div>
<ul class="guide-info">

View File

@@ -42,7 +42,7 @@
</div>
<div class="input-field">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="quantity" name="quantity" min="1" max="9999999999"
th:value="${detail.quantity}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="수량을 입력해 주세요">
th:value="${detail.quantity}" maxlength="10" placeholder="수량을 입력해 주세요">
</div>
<ul class="guide-info">
<li>예 : 2, 2.5</li>
@@ -97,7 +97,7 @@
</div>
<div class="input-field type-price">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="estimatedValue" name="estimatedValue" min="1" max="9999999999"
th:value="${detail.estimatedValue}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="금액을 입력해 주세요">
th:value="${detail.estimatedValue}" maxlength="10" placeholder="금액을 입력해 주세요">
<span class="input-field-txt">원</span>
</div>
<ul class="guide-info">

View File

@@ -110,7 +110,7 @@
</div>
<div class="input-field">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="quantity" name="quantity" min="1" max="9999999999"
th:value="${detail.quantity}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="수량을 입력해 주세요">
th:value="${detail.quantity}" maxlength="10" placeholder="수량을 입력해 주세요">
</div>
<ul class="guide-info">
<li>예 : 2, 2.5</li>
@@ -164,8 +164,8 @@
</label>
</div>
<div class="input-field type-price">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="price" name="price" min="1" max="9999999999"
th:value="${detail.price}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="금액을 입력해 주세요">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="price" name="price" step="0" min="1" max="9999999999"
th:value="${detail.price}" maxlength="10" placeholder="금액을 입력해 주세요">
<span class="input-field-txt">원</span>
</div>
<ul class="guide-info">
@@ -181,8 +181,8 @@
</label>
</div>
<div class="input-field type-price">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="estimatedValue" name="estimatedValue" min="1" max="9999999999"
th:value="${detail.estimatedValue}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="금액을 입력해 주세요">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="estimatedValue" name="estimatedValue" step="0" min="1" max="9999999999"
th:value="${detail.estimatedValue}" maxlength="10" placeholder="금액을 입력해 주세요">
<span class="input-field-txt">원</span>
</div>
<ul class="guide-info">

View File

@@ -46,7 +46,7 @@
</div>
<div class="input-field type-hour">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="ownedHours" name="ownedHours" min="1" max="9999999999"
th:value="${detail.ownedHours}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.ownedHours}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>
@@ -59,7 +59,7 @@
</div>
<div class="input-field type-hour">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="leasedHours" name="leasedHours" min="1" max="9999999999"
th:value="${detail.leasedHours}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.leasedHours}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>

View File

@@ -52,7 +52,7 @@
</div>
<div class="input-field">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="workLandArea" name="workLandArea" min="1" max="9999999999"
th:value="${detail.workLandArea}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="작업 면적을 입력해 주세요">
th:value="${detail.workLandArea}" maxlength="10" placeholder="작업 면적을 입력해 주세요">
</div>
<ul class="guide-info">
<li>예 : 180, 6</li>
@@ -109,7 +109,7 @@
</div>
<div class="input-field">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="harvestQuantity" name="harvestQuantity" min="1" max="9999999999"
th:value="${detail.harvestQuantity}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="수확량을 입력해 주세요">
th:value="${detail.harvestQuantity}" maxlength="10" placeholder="수확량을 입력해 주세요">
</div>
</div>
<div class="select-group">
@@ -174,7 +174,7 @@
</div>
<div class="input-field type-hour">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="ownerTime" name="ownerTime" min="1" max="9999999999"
th:value="${detail.ownerTime}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.ownerTime}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>
@@ -187,7 +187,7 @@
</div>
<div class="input-field type-hour">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="spouseTime" name="spouseTime" min="1" max="9999999999"
th:value="${detail.spouseTime}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.spouseTime}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>
@@ -202,7 +202,7 @@
<div class="input-field type-hour">
<span class="input-front-txt">남</span>
<input type="number" inputmode="decimal" pattern="[0-9]*" id="familyMHours" name="familyMHours" min="1" max="9999999999"
th:value="${detail.familyMHours}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.familyMHours}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>
@@ -210,7 +210,7 @@
<div class="input-field type-hour">
<span class="input-front-txt">여</span>
<input type="number" inputmode="decimal" pattern="[0-9]*" id="familyFHours" name="familyFHours" min="1" max="9999999999"
th:value="${detail.familyFHours}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.familyFHours}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>
@@ -227,7 +227,7 @@
<div class="input-field type-hour">
<span class="input-front-txt">남</span>
<input type="number" inputmode="decimal" pattern="[0-9]*" id="hiredMHours" name="hiredMHours" min="1" max="9999999999"
th:value="${detail.hiredMHours}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.hiredMHours}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>
@@ -235,7 +235,7 @@
<div class="input-field type-hour">
<span class="input-front-txt">여</span>
<input type="number" inputmode="decimal" pattern="[0-9]*" id="hiredFHours" name="hiredFHours" min="1" max="9999999999"
th:value="${detail.hiredFHours}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.hiredFHours}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>
@@ -252,7 +252,7 @@
<div class="input-field type-hour">
<span class="input-front-txt">남</span>
<input type="number" inputmode="decimal" pattern="[0-9]*" id="sharedMHours" name="sharedMHours" min="1" max="9999999999"
th:value="${detail.sharedMHours}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.sharedMHours}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>
@@ -260,7 +260,7 @@
<div class="input-field type-hour">
<span class="input-front-txt">여</span>
<input type="number" inputmode="decimal" pattern="[0-9]*" id="sharedFHours" name="sharedFHours" min="1" max="9999999999"
th:value="${detail.sharedFHours}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.sharedFHours}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>
@@ -277,7 +277,7 @@
<div class="input-field type-hour">
<span class="input-front-txt">남</span>
<input type="number" inputmode="decimal" pattern="[0-9]*" id="volunteerMHours" name="volunteerMHours" min="1" max="9999999999"
th:value="${detail.volunteerMHours}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.volunteerMHours}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>
@@ -285,7 +285,7 @@
<div class="input-field type-hour">
<span class="input-front-txt">여</span>
<input type="number" inputmode="decimal" pattern="[0-9]*" id="volunteerFHours" name="volunteerFHours" min="1" max="9999999999"
th:value="${detail.volunteerFHours}" maxlength="10" oninput="kri.form.maxlength(this)" placeholder="00">
th:value="${detail.volunteerFHours}" maxlength="10" placeholder="00">
<span class="input-field-txt">시간</span>
</div>
</div>