change category create.jsp To prevent the use of minus KAN code.

This commit is contained in:
Kana
2024-01-09 18:36:13 +09:00
parent 8d6174c39e
commit 48cc35431a

View File

@@ -56,12 +56,11 @@
aria-describedby="basic-addon1"> aria-describedby="basic-addon1">
</div> </div>
<div class="input-group mb-3 w-40 col-centered"> <div class="input-group mb-3 w-40 col-centered">
<input type="number" name="kan_code" id="kan_code" class="form-control" <input type="number" min="1" name="kan_code" id="kan_code" class="form-control"
placeholder="KAN 분류코드" aria-label="KAN 분류코드" value="${dto.kan_code }" placeholder="KAN 분류코드" aria-label="KAN 분류코드" value="${dto.kan_code }"
aria-describedby="button-addon2"> aria-describedby="button-addon2">
<button class="btn btn-outline-secondary" id="checkKan" <button class="btn btn-outline-secondary rounded-end" id="checkKan"
style="background-color:#FF5E5E;" type="button" style="background-color:#FF5E5E;" type="button" >중복확인</button>
id="button-addon2">중복확인</button>
<input type='hidden' id='kan_chack' value='0'> <input type='hidden' id='kan_chack' value='0'>
</div> </div>
</div> </div>
@@ -95,6 +94,14 @@
return false; return false;
} }
//1이상의 정수만 입력받는다.
if (kanCode <= 0){
alert("KAN 분류코드는 1 이상의 정수를 입력해주세요");
$("#kan_code").focus();
$("#checkKan").prop("disabled", false);
return false;
}
$.ajax({ $.ajax({
url: "/category/checkKancode", url: "/category/checkKancode",
type: "post", type: "post",