글 수 207
<p align="center"><font color="#0033CC">주민번호를 넣고 체크 버튼을 눌러서 확인해 보세요</font></p>
<form name="jumins">
<p align="center"><input id="text2" name="jumin1" maxlength="6" size="6"> -
<input id="text3" name="jumin2" maxlength="7" size="7">
<input type="button" value="체 크" id="button1" name="button1" onclick="juminCheck()"></form>
<script language="JavaScript">
<!--
function error (elem,text) {
if (errfound) return;
window.alert(text);
elem.select();
elem.focus();
errfound=true;
}
function juminCheck()
{
errfound = false;
var str_jumin1 = jumins.jumin1.value;
var str_jumin2 = jumins.jumin2.value;
var checkImg='';
var i3=0
for (var i=0;i<str_jumin1.length;i++)
{
var ch1 = str_jumin1.substring(i,i+1);
if (ch1<'0' || ch1>'9') { i3=i3+1 }
}
if ((str_jumin1 == '') || ( i3 != 0 ))
{
error(jumins.jumin1,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
var i4=0
for (var i=0;i<str_jumin2.length;i++)
{
var ch1 = str_jumin2.substring(i,i+1);
if (ch1<'0' || ch1>'9') { i4=i4+1 }
}
if ((str_jumin2 == '') || ( i4 != 0 ))
{
error(jumins.jumin2,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
if(str_jumin1.substring(0,1) < 4)
{
error(jumins.jumin2,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
if(str_jumin2.substring(0,1) > 2)
{
error(jumins.jumin2,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
if((str_jumin1.length > 7) || (str_jumin2.length > 8))
{
error(jumins.jumin2,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
if ((str_jumin1 == '72') || ( str_jumin2 == '18'))
{
error(jumins.jumin1,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
var f1=str_jumin1.substring(0,1)
var f2=str_jumin1.substring(1,2)
var f3=str_jumin1.substring(2,3)
var f4=str_jumin1.substring(3,4)
var f5=str_jumin1.substring(4,5)
var f6=str_jumin1.substring(5,6)
var hap=f1*2+f2*3+f3*4+f4*5+f5*6+f6*7
var l1=str_jumin2.substring(0,1)
var l2=str_jumin2.substring(1,2)
var l3=str_jumin2.substring(2,3)
var l4=str_jumin2.substring(3,4)
var l5=str_jumin2.substring(4,5)
var l6=str_jumin2.substring(5,6)
var l7=str_jumin2.substring(6,7)
hap=hap+l1*8+l2*9+l3*2+l4*3+l5*4+l6*5
hap=hap%11
hap=11-hap
hap=hap%10
if (hap != l7)
{
error(jumins.jumin1,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
var i9=0
if (!errfound)alert('정확한 주민번호 입니다.');
}
//-->
</script>
<form name="jumins">
<p align="center"><input id="text2" name="jumin1" maxlength="6" size="6"> -
<input id="text3" name="jumin2" maxlength="7" size="7">
<input type="button" value="체 크" id="button1" name="button1" onclick="juminCheck()"></form>
<script language="JavaScript">
<!--
function error (elem,text) {
if (errfound) return;
window.alert(text);
elem.select();
elem.focus();
errfound=true;
}
function juminCheck()
{
errfound = false;
var str_jumin1 = jumins.jumin1.value;
var str_jumin2 = jumins.jumin2.value;
var checkImg='';
var i3=0
for (var i=0;i<str_jumin1.length;i++)
{
var ch1 = str_jumin1.substring(i,i+1);
if (ch1<'0' || ch1>'9') { i3=i3+1 }
}
if ((str_jumin1 == '') || ( i3 != 0 ))
{
error(jumins.jumin1,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
var i4=0
for (var i=0;i<str_jumin2.length;i++)
{
var ch1 = str_jumin2.substring(i,i+1);
if (ch1<'0' || ch1>'9') { i4=i4+1 }
}
if ((str_jumin2 == '') || ( i4 != 0 ))
{
error(jumins.jumin2,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
if(str_jumin1.substring(0,1) < 4)
{
error(jumins.jumin2,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
if(str_jumin2.substring(0,1) > 2)
{
error(jumins.jumin2,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
if((str_jumin1.length > 7) || (str_jumin2.length > 8))
{
error(jumins.jumin2,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
if ((str_jumin1 == '72') || ( str_jumin2 == '18'))
{
error(jumins.jumin1,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
var f1=str_jumin1.substring(0,1)
var f2=str_jumin1.substring(1,2)
var f3=str_jumin1.substring(2,3)
var f4=str_jumin1.substring(3,4)
var f5=str_jumin1.substring(4,5)
var f6=str_jumin1.substring(5,6)
var hap=f1*2+f2*3+f3*4+f4*5+f5*6+f6*7
var l1=str_jumin2.substring(0,1)
var l2=str_jumin2.substring(1,2)
var l3=str_jumin2.substring(2,3)
var l4=str_jumin2.substring(3,4)
var l5=str_jumin2.substring(4,5)
var l6=str_jumin2.substring(5,6)
var l7=str_jumin2.substring(6,7)
hap=hap+l1*8+l2*9+l3*2+l4*3+l5*4+l6*5
hap=hap%11
hap=11-hap
hap=hap%10
if (hap != l7)
{
error(jumins.jumin1,'주민등록번호가 잘못되었습니다.\n\n다시입력해주세요!');
}
var i9=0
if (!errfound)alert('정확한 주민번호 입니다.');
}
//-->
</script>