// 영문, 숫자 체크
function checkValid(strText) {
if (strText.match(/^[\w]+$/)) {
return true;
}
else {
return false;
}
}
// 도메인 체크
function checkValid1(strText) {
if (strText.match(/^[\w]+[\.]+[\w]+$/)) {
return true;
}
else {
return false;
}
}
// 한글, 영문, 숫자 체크
function checkValid2(strText) {
if (strText.match(/^[가-힣\w]+$/)) {
return true;
}
else {
return false;
}
}
// 한글, 영문, 숫자 조합 체크
function checkValid3(strText) {
if (strText.match(/^[\a-zA-Z]+[0-9]+[\w]+$/)) {
return true;
}
else {
return false;
}
}
function checkdate(input) {
var validformat = /^\d{4}\-\d{2}\-\d{2}$/; //Basic check for format validity
var returnval = false;
if (!validformat.test(input.value)) {
alert("날짜 형식이 올바르지 않습니다. YYYY-MM-DD");
} else { //Detailed check for valid date ranges
var yearfield = input.value.split("-")[0];
var monthfield = input.value.split("-")[1];
var dayfield = input.value.split("-")[2];
var dayobj = new Date(yearfield, monthfield - 1, dayfield);
}
if ((dayobj.getMonth() + 1 != monthfield)
|| (dayobj.getDate() != dayfield)
|| (dayobj.getFullYear() != yearfield)) {
alert("날짜 형식이 올바르지 않습니다. YYYY-MM-DD");
} else {
//alert ('Correct date');
returnval = true;
}
if (returnval == false) {
input.select();
}
return returnval;
}