[FO] 가구 연락처 div d-flex 때문에 포커스를 tel2 로 이동 처리리

This commit is contained in:
김현주
2025-07-18 17:34:13 +09:00
parent 9b62045905
commit 7b1f4d9813

View File

@@ -49,7 +49,7 @@
<div id="tel1Id" class="component-select bottom-sheet"
th:data-props-default="${userInfo.tel1}" data-props-type="bottomSheet">
<input type="hidden" name="tel1" th:field="*{tel1}" data-type="select">
<input type="hidden" id="tel1" name="tel1" th:value="${userInfo.tel1}" data-type="select">
<button type="button" class="select-box">
<span class="select-txt"></span>
</button>
@@ -345,7 +345,7 @@
ENV.module.confirmPopup = document.querySelector(".confirmPopup").ui;
const $selectTel = document.querySelector('#tel1Id');
ENV.select.selectTel = new etUI.components.SelectBox();
ENV.select.selectTel = $selectTel.ui;
ENV.select.selectTel.core.init($selectTel, {
selectItemCallback({selectValue, dataValue}){
document.querySelector('#tel1').value = dataValue;
@@ -375,10 +375,14 @@
const errors = [];
if (!form.ownerName.value) errors.push({field: 'ownerName', message: '이름을 입력해 주세요.'});
if (!form.ownerAge.value) errors.push({field: 'ownerAge', message: '연령을 입력해 주세요.'});
if (form.ownerAge.value < 0 || form.ownerAge.value > 120) errors.push({field: 'ownerAge', message: '연령은 0세이상 120세 이하이어야 합니다.'});
if (form.ownerAge.value < 0 || form.ownerAge.value > 120) errors.push({field: 'ownerAge', message: '연령은 0세이상 120세 이하이어야 합니다.'});
if (form.tel1.value || form.tel2.value || form.tel3.value) {
if (!form.tel1.value || !form.tel2.value || !form.tel3.value) {
errors.push({ field: 'tel1', message: '가구 연락처를 모두 입력해 주세요.' });
if (!form.tel1.value || !form.tel2.value) {
errors.push({ field: 'tel2', message: '가구 연락처를 모두 입력해 주세요.' });
} else {
errors.push({ field: 'tel3', message: '가구 연락처를 모두 입력해 주세요.' });
}
} else {
const telRegex = /^(0[2-7][0-9]?)$/; // 지역번호 (예: 02, 031, 032 등)
if (!telRegex.test(form.tel1.value)) errors.push({ field: 'tel1', message: '가구 연락처를 입력해주세요' }); // 유효한 지역번호를 선택해 주세요.