Skip to content

Commit

Permalink
code update
Browse files Browse the repository at this point in the history
  • Loading branch information
dlgustj321 committed Nov 8, 2024
1 parent c76d3fb commit 1e93068
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion SM1-2/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,24 @@ passwordConfirmInput.addEventListener('input', validateForm);
// 폼 제출 함수
function submitForm() {
if (!validateForm()) {
alert('회원가입이 완료되었습니다.');
alert('회원가입이 완료되었습니다!');
window.location.href = "/login";
return true;
} else if (USER_DATA.some(user => user.email === email)) {
alert("이미 존재하는 이메일입니다!");
return false;
} else if (!emailPattern.test(email)) {
alert("잘못된 형식의 이메일입니다!");
return false;
} else if (password.length < 8) {
alert("비밀번호를 8자 이상 입력해주세요!");
return false;
} else if (!password) {
alert("비밀번호를 입력해주세요!");
return false;
} else if (passwordConfirm !== passwordInput.value.trim()) {
alert("비밀번호가 일치하지 않습니다!");
return false;
}
}

Expand Down

0 comments on commit 1e93068

Please sign in to comment.