Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

조민영 과제 제출합니다 #3

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
조민영 3주차 과제 수정본3
JOE, MIN YOUNG committed Oct 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 95aa7696b46efbd6a0e65a91dc99bc609baef393
24 changes: 14 additions & 10 deletions 조민영/test3.html
Original file line number Diff line number Diff line change
@@ -94,32 +94,30 @@
let errorMsgList = {
id: {
fail: "아이디는 3 글자 이상입니다.",
null: "위 입력항목 모두 공백일 수 없습니다",
},
pw: {
fail: "비밀번호는 6 글자 이상입니다",
null: "위 입력항목 모두 공백일 수 없습니다",
},
email: {
fail: "이메일 형식을 지켜야합니다",
null: "위 입력항목 모두 공백일 수 없습니다",
},
phone: {
fail: "전화번호는 -없이 숫자 11자입니다",
null: "위 입력항목 모두 공백일 수 없습니다",
},
birth: {
fail: "생년월일은 2002-04-14와 같은 형식입니다",
null: "위 입력항목 모두 공백일 수 없습니다",
},
name: {
null: "이름을 입력하세요",
},
empty: {
null: "위 입력항목 모두 공백일 수 없습니다",
},
};

function idCheck(value) {
if (value === "" || value === " ") {
errorMsg.textContent = errorMsgList.id.null;
emptyCheck(value);
} else if (value.length < 4) {
errorMsg.textContent = errorMsgList.id.fail;
} else {
@@ -128,7 +126,7 @@
}
function pwCheck(value) {
if (value === "" || value === " ") {
errorMsg2.textContent = errorMsgList.pw.null;
emptyCheck(value);
} else if (value.length < 7) {
errorMsg2.textContent = errorMsgList.pw.fail;
} else {
@@ -137,7 +135,7 @@
}
function phoneCheck(value) {
if (value === "" || value === " ") {
errorMsg3.textContent = errorMsgList.phone.null;
emptyCheck(value);
} else if (!phoneGuide.test(value)) {
errorMsg3.textContent = errorMsgList.phone.fail;
} else {
@@ -147,7 +145,7 @@

function birthCheck(value) {
if (value === "" || value === " ") {
errorMsg4.textContent = errorMsgList.birth.null;
emptyCheck(value);
} else if (!birthGuide.test(value)) {
errorMsg4.textContent = errorMsgList.birth.fail;
} else {
@@ -156,7 +154,7 @@
}
function emailCheck(value) {
if (value === "" || value === " ") {
errorMsg5.textContent = errorMsgList.email.null;
emptyCheck(value);
} else if (!emailGuide.test(value)) {
errorMsg5.textContent = errorMsgList.email.fail;
} else {
@@ -171,6 +169,12 @@
}
}

function emptyCheck(value) {
if (value === "" || value === " ") {
errorMsg.textContent = errorMsgList.empty.null;
}
}

function countCheck(count) {
if (count == 6) {
location.href = "success.html";