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

· 10년 전 · 1300

<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,380
9년 전 조회 1,473
9년 전 조회 1,390
9년 전 조회 1,462
9년 전 조회 1,556
9년 전 조회 1,370
9년 전 조회 1,406
9년 전 조회 1,396
9년 전 조회 1,524
9년 전 조회 1,387
9년 전 조회 1,497
9년 전 조회 1,337
9년 전 조회 1,408
9년 전 조회 1,234
9년 전 조회 1,460
9년 전 조회 1,277
9년 전 조회 1,281
9년 전 조회 1,375
10년 전 조회 1,305
10년 전 조회 1,330
10년 전 조회 1,246
10년 전 조회 1,656
10년 전 조회 1,707
10년 전 조회 1,677
10년 전 조회 1,612
10년 전 조회 1,402
10년 전 조회 1,544
10년 전 조회 1,684
10년 전 조회 1,372
10년 전 조회 1,684
10년 전 조회 1,657
10년 전 조회 2,024
10년 전 조회 1,630
10년 전 조회 1,849
10년 전 조회 1,480
10년 전 조회 1,601
10년 전 조회 1,332
10년 전 조회 1,388
10년 전 조회 1,458
10년 전 조회 1,450
10년 전 조회 1,589
10년 전 조회 1,368
10년 전 조회 1,400
10년 전 조회 1,353
10년 전 조회 1,322
10년 전 조회 1,365
10년 전 조회 1,210
10년 전 조회 1,252
10년 전 조회 1,174
10년 전 조회 1,301
10년 전 조회 1,252
10년 전 조회 1,730
10년 전 조회 1,213
10년 전 조회 1,175
10년 전 조회 1,421
10년 전 조회 1,229
10년 전 조회 1,201
10년 전 조회 1,207
10년 전 조회 1,161
10년 전 조회 1,096
10년 전 조회 1,078
10년 전 조회 1,165
10년 전 조회 1,173
10년 전 조회 1,100
10년 전 조회 998
10년 전 조회 1,079
10년 전 조회 1,052
10년 전 조회 1,087
10년 전 조회 1,126
10년 전 조회 1,118
10년 전 조회 1,069
10년 전 조회 1,077
10년 전 조회 1,135
10년 전 조회 1,083
10년 전 조회 1,168
10년 전 조회 1,105
10년 전 조회 1,041
10년 전 조회 1,012
10년 전 조회 1,043
10년 전 조회 999
10년 전 조회 1,044
10년 전 조회 1,074
10년 전 조회 1,025
10년 전 조회 1,091
10년 전 조회 1,038
10년 전 조회 1,125
10년 전 조회 1,220
10년 전 조회 1,180
10년 전 조회 1,128
10년 전 조회 1,051
10년 전 조회 1,153
10년 전 조회 1,076
10년 전 조회 1,110
10년 전 조회 1,053
10년 전 조회 1,039
10년 전 조회 1,039
10년 전 조회 1,060
10년 전 조회 1,165
10년 전 조회 1,095
10년 전 조회 1,177