프로토~ 4

This commit is contained in:
doyeon 2025-10-20 14:51:56 +09:00
parent 0f1ac11982
commit c6621ff151
4 changed files with 11 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -144,9 +144,10 @@
id="businessNumber"
name="businessNumber"
class="form-input"
placeholder="123-45-67890"
placeholder="숫자만 입력하세요 (예: 1234567890)"
required
maxlength="12"
inputmode="numeric"
style="flex: 1;"
autocomplete="off"
>
@ -160,6 +161,9 @@
검증하기
</button>
</div>
<div class="body-s text-muted" style="margin-top: 4px;">
숫자만 입력하시면 자동으로 형식이 맞춰집니다
</div>
<div id="verifyResult" style="margin-top: 8px;"></div>
</div>
</section>

View File

@ -509,8 +509,8 @@
}
}
// 사업자번호 필드
if (input.name === 'business_number' && input.value) {
// 사업자번호 필드 (name이 businessNumber인 경우도 처리)
if ((input.name === 'business_number' || input.name === 'businessNumber') && input.value) {
// 자동 하이픈 추가
let value = input.value.replace(/[^0-9]/g, '');
if (value.length > 3 && value.length <= 5) {
@ -520,13 +520,16 @@
}
input.value = value;
// 검증
// 검증 (완전한 형식일 때만)
if (value.length === 12) {
if (!window.FormValidator.isValidBusinessNumber(value)) {
window.FormValidator.showError(input, '올바른 사업자번호 형식을 입력하세요.');
} else {
window.FormValidator.clearError(input);
}
} else {
// 입력 중일 때는 에러 제거
window.FormValidator.clearError(input);
}
}
});