From 582a3e0f69dabc03d280fca6705c263ad8b3ac0e Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 30 Jun 2026 09:42:34 +0900 Subject: [PATCH] =?UTF-8?q?=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20?= =?UTF-8?q?=ED=95=84=EC=88=98=20=ED=95=AD=EB=AA=A9=20=EA=B2=80=EC=A6=9D=20?= =?UTF-8?q?=EA=B0=95=ED=99=94:=20-=20=EC=9E=85=EB=A0=A5/=EB=AF=B8=EC=B6=A9?= =?UTF-8?q?=EC=A1=B1=20=ED=95=AD=EB=AA=A9=20=EA=B5=AC=EC=B2=B4=EC=A0=81=20?= =?UTF-8?q?=EC=88=98=EC=A7=91=20=EB=B0=8F=20=EC=97=90=EB=9F=AC=20=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=EC=A7=80=20=EA=B0=9C=EC=84=A0=20-=20=EC=8B=9C?= =?UTF-8?q?=EB=82=98=EB=A6=AC=EC=98=A4=EB=B3=84/=EA=B3=B5=ED=86=B5=20?= =?UTF-8?q?=ED=95=AD=EB=AA=A9=20=EA=B2=80=EC=A6=9D=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/apps/register/orgUserRegister.html | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/main/resources/templates/views/apps/register/orgUserRegister.html b/src/main/resources/templates/views/apps/register/orgUserRegister.html index 25841fd..90dcf87 100644 --- a/src/main/resources/templates/views/apps/register/orgUserRegister.html +++ b/src/main/resources/templates/views/apps/register/orgUserRegister.html @@ -375,6 +375,35 @@ return scenarioValidation && commonValidation; } + // 미입력/미충족 항목을 구체적으로 수집 + function collectFormErrors() { + const errors = []; + + // 시나리오별 항목 + if (registrationScenario === 'new') { + const loginIdElement = document.getElementById('loginId'); + const userNameElement = document.getElementById('userName'); + + if (!(loginIdElement && isValidEmail(loginIdElement.value))) errors.push('이메일 아이디를 올바르게 입력해주세요.'); + if (!(userNameElement && userNameElement.value.trim() !== '')) errors.push('성명을 입력해주세요.'); + if (!isAuthVerified) errors.push('휴대폰 인증을 완료해주세요.'); + if (document.getElementById('isPasswordValid')?.value.trim() !== 'true') errors.push('비밀번호 조건을 확인해주세요.'); + if (document.getElementById('isPasswordMatch')?.value.trim() !== 'true') errors.push('비밀번호 확인이 일치하지 않습니다.'); + } + + // 공통 항목 + const notificationConsentEl = document.getElementById('notificationConsent'); + if ($('#orgName').val().trim() === '') errors.push('회사명을 입력해주세요.'); + if ($('#compRegNo').val().trim() === '') errors.push('사업자등록번호를 올바르게 입력해주세요.'); + if ($('#corpRegNo').val().trim() === '') errors.push('법인등록번호를 올바르게 입력해주세요.'); + if ($('#compRegFile').val().trim() === '') errors.push('사업자등록증 파일을 첨부해주세요.'); + if (!$('#termsOfUse').prop('checked')) errors.push('이용약관에 동의해주세요.'); + if (!$('#privacyCollect').prop('checked')) errors.push('개인정보 수집·이용에 동의해주세요.'); + if (notificationConsentEl && !notificationConsentEl.checked) errors.push('알림 수신에 동의해주세요.'); + + return errors; + } + let isSubmitting = false; // 등록 버튼 클릭 이벤트 @@ -426,7 +455,10 @@ isPasswordMatch }); - let errorMessage = '모든 필수 항목을 입력하고 약관에 동의해주세요.' + const errors = collectFormErrors(); + let errorMessage = errors.length > 0 + ? '아래 항목을 확인해주세요.

' + errors.map(e => '• ' + e).join('
') + : '모든 필수 항목을 입력하고 약관에 동의해주세요.'; customPopups.showAlert(errorMessage); // Reset submission state since validation failed