휴대폰번호 검사 하기 입니다.

· 10년 전 · 1142

<SCRIPT LANGUAGE="JavaScript">
<!--
function maskHp(obj) {
    var str = obj.value;
    if ( str ) {
        //var pattern = /[^(ㄱ-힣)]|[-/\s]/g;
        var RegNotNum  = /[\D]/g;
        var pattern = "";
        var format   = "";

        // delete not number ㅋ
        str = str.replace(RegNotNum,'');

        //if( str.length < 4 ) return str;
        if( str.length < 4 ) {
            if( str.length == 3 ) {
                format = "$1";
                pattern = /(^01[\d]{0,1})/;
            } else {
                format = "$1";
                pattern = /(^0[1]?[\d]{0,1})/;
            }
        } else if( str.length > 3 && str.length < 7 ) {
            format = "$1-$2";
            pattern = /(^01[\d]{1})([\d]+)/;
        } else if(str.length == 7 ) {
            format = "$1-$2";
            pattern = /(^01[\d]{1})([\d]{4})/;
        } else {
            format = "$1-$2-$3";
            pattern = /(^01[\d]{1})([\d]{4})([\d]+)/;
        }

        //while( pattern.test(str) ) {
        if ( pattern.test(str) ) {
            obj.value = str.replace(pattern, format);
        } else {
            obj.value = "";
        }
    }
}


function isHpFormat() {
  var str = window.event.srcElement.value;
  //alert ( str );
  if ( window.event.propertyName == "value" && str ) {
        var pattern = "";
        str = str.replace(/[\D]/g,'');
        if( str.length < 4 ) {
            if( str.length == 3 ) pattern = /(^01[\d]{1})/;
            else                  pattern = /(^0[1]?[\d]{0,1})/;
        } else if( str.length > 3 && str.length < 7 ) {
            pattern = /(^01[\d]{1})([\d]+)$/;
        } else if(str.length == 7 ) {
            pattern = /(^01[\d]{1})([\d]{4})/;
        } else {
            pattern = /(^01[\d]{1})([\d]{4})([\d]+)/;
        }
        if ( pattern.test(str) ) {
            return true;
        } else {
            return false;
        }
  } else {
        return true;
      // undefined
  }
}

//-->
</SCRIPT>
<input type='text' id='phon_num' value=''
size='14' maxlength='13'
onpropertychange='if(!isHpFormat()){alert("핸드폰 번호가 정확히 입력해주세요.");this.value="";}'
onkeyup ='maskHp(this);'
onkeydown='maskHp(this);'  >
 

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
9년 전 조회 1,183
9년 전 조회 1,294
9년 전 조회 1,176
9년 전 조회 1,265
9년 전 조회 1,384
9년 전 조회 1,174
9년 전 조회 1,216
9년 전 조회 1,203
9년 전 조회 1,345
9년 전 조회 1,175
9년 전 조회 1,283
9년 전 조회 1,141
9년 전 조회 1,199
9년 전 조회 1,037
9년 전 조회 1,253
9년 전 조회 1,115
9년 전 조회 1,128
9년 전 조회 1,177
9년 전 조회 1,136
9년 전 조회 1,153
9년 전 조회 1,089
10년 전 조회 1,467
10년 전 조회 1,547
10년 전 조회 1,500
10년 전 조회 1,433
10년 전 조회 1,234
10년 전 조회 1,371
10년 전 조회 1,520
10년 전 조회 1,197
10년 전 조회 1,548
10년 전 조회 1,496
10년 전 조회 1,861
10년 전 조회 1,476
10년 전 조회 1,680
10년 전 조회 1,304
10년 전 조회 1,456
10년 전 조회 1,172
10년 전 조회 1,217
10년 전 조회 1,296
10년 전 조회 1,290
10년 전 조회 1,409
10년 전 조회 1,227
10년 전 조회 1,243
10년 전 조회 1,202
10년 전 조회 1,155
10년 전 조회 1,230
10년 전 조회 1,079
10년 전 조회 1,112
10년 전 조회 1,022
10년 전 조회 1,143
10년 전 조회 1,121
10년 전 조회 1,589
10년 전 조회 1,066
10년 전 조회 1,028
10년 전 조회 1,279
10년 전 조회 1,092
10년 전 조회 1,051
10년 전 조회 1,067
10년 전 조회 1,044
10년 전 조회 979
10년 전 조회 952
10년 전 조회 1,012
10년 전 조회 1,030
10년 전 조회 974
10년 전 조회 894
10년 전 조회 965
10년 전 조회 921
10년 전 조회 957
10년 전 조회 1,002
10년 전 조회 1,004
10년 전 조회 947
10년 전 조회 954
10년 전 조회 1,019
10년 전 조회 1,000
10년 전 조회 1,055
10년 전 조회 997
10년 전 조회 930
10년 전 조회 910
10년 전 조회 927
10년 전 조회 897
10년 전 조회 937
10년 전 조회 965
10년 전 조회 917
10년 전 조회 967
10년 전 조회 928
10년 전 조회 1,009
10년 전 조회 1,127
10년 전 조회 1,074
10년 전 조회 1,024
10년 전 조회 953
10년 전 조회 1,043
10년 전 조회 960
10년 전 조회 988
10년 전 조회 951
10년 전 조회 942
10년 전 조회 927
10년 전 조회 963
10년 전 조회 1,033
10년 전 조회 980
10년 전 조회 1,069