반응형
주넝아???? | 주넝이
http://blog.naver.com/akswnsjd1/60037150206
http://blog.naver.com/akswnsjd1/60037150206
function check_jumin(form) {
var chk =0;
var yy = join.jumin1.value.substring(0,2);
var mm = join.jumin1.value.substring(2,4);
var dd = join.jumin1.value.substring(4,6);
var sex = join.jumin2.value.substring(0,1);
if (join.jumin2.value.split(" ").join("") == "") {
alert ('주민등록번호를 입력하세요.');
join.jumin1.value = "";
join.jumin1.focus();
return false;
}
if (isNaN(join.jumin1.value) || isNaN(join.jumin2.value)) {
alert('주민등록번호는 숫자만 가능합니다.');
join.jumin1.value = "";
join.jumin2.value = "";
join.jumin1.focus();
return false;
}
if ((join.jumin1.value.length != 6) || (mm < 1 || mm > 12 || dd < 1)) {
alert ('주민등록번호 앞자리가 잘못되었습니다.');
join.jumin1.value = "";
join.jumin1.focus();
return false;
}
if ((sex != 1 && sex != 2 ) || (join.jumin2.value.length != 7 )) {
alert ('주민등록번호 뒷자리가 잘못되었습니다.');
join.jumin2.value = "";
join.jumin2.focus();
return false;
}
for (var i = 0; i <= 5 ; i++) {
chk = chk + ((i % 8 + 2) * parseInt(join.jumin1.value.substring(i, i + 1)))
}
for (var i = 6; i <= 11 ; i++) {
chk = chk + ((i % 8 + 2) * parseInt(join.jumin2.value.substring(i - 6, i - 5)))
}
chk = 11 - (chk % 11)
chk = chk % 10
if (chk != join.jumin2.value.substring(6, 7)) {
join.jumin1.value = "";
join.jumin2.value = "";
alert ('올바른 주민등록번호가 아닙니다.');
join.jumin1.focus();
return false;
}
else {
join.submit();
alert("가입완료");
}
return true;
}
var chk =0;
var yy = join.jumin1.value.substring(0,2);
var mm = join.jumin1.value.substring(2,4);
var dd = join.jumin1.value.substring(4,6);
var sex = join.jumin2.value.substring(0,1);
if (join.jumin2.value.split(" ").join("") == "") {
alert ('주민등록번호를 입력하세요.');
join.jumin1.value = "";
join.jumin1.focus();
return false;
}
if (isNaN(join.jumin1.value) || isNaN(join.jumin2.value)) {
alert('주민등록번호는 숫자만 가능합니다.');
join.jumin1.value = "";
join.jumin2.value = "";
join.jumin1.focus();
return false;
}
if ((join.jumin1.value.length != 6) || (mm < 1 || mm > 12 || dd < 1)) {
alert ('주민등록번호 앞자리가 잘못되었습니다.');
join.jumin1.value = "";
join.jumin1.focus();
return false;
}
if ((sex != 1 && sex != 2 ) || (join.jumin2.value.length != 7 )) {
alert ('주민등록번호 뒷자리가 잘못되었습니다.');
join.jumin2.value = "";
join.jumin2.focus();
return false;
}
for (var i = 0; i <= 5 ; i++) {
chk = chk + ((i % 8 + 2) * parseInt(join.jumin1.value.substring(i, i + 1)))
}
for (var i = 6; i <= 11 ; i++) {
chk = chk + ((i % 8 + 2) * parseInt(join.jumin2.value.substring(i - 6, i - 5)))
}
chk = 11 - (chk % 11)
chk = chk % 10
if (chk != join.jumin2.value.substring(6, 7)) {
join.jumin1.value = "";
join.jumin2.value = "";
alert ('올바른 주민등록번호가 아닙니다.');
join.jumin1.focus();
return false;
}
else {
join.submit();
alert("가입완료");
}
return true;
}
반응형