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

· 10년 전 · 1529

<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,585
10년 전 조회 1,676
10년 전 조회 1,618
10년 전 조회 1,653
10년 전 조회 1,764
10년 전 조회 1,561
10년 전 조회 1,577
10년 전 조회 1,610
10년 전 조회 1,731
10년 전 조회 1,581
10년 전 조회 1,692
10년 전 조회 1,500
10년 전 조회 1,588
10년 전 조회 1,403
10년 전 조회 1,623
10년 전 조회 1,423
10년 전 조회 1,470
10년 전 조회 1,578
10년 전 조회 1,485
10년 전 조회 1,513
10년 전 조회 1,442
10년 전 조회 1,853
10년 전 조회 1,882
10년 전 조회 1,860
10년 전 조회 1,822
10년 전 조회 1,600
10년 전 조회 1,729
10년 전 조회 1,897
10년 전 조회 1,604
10년 전 조회 1,879
10년 전 조회 1,858
10년 전 조회 2,235
10년 전 조회 1,843
10년 전 조회 2,049
10년 전 조회 1,683
10년 전 조회 1,828
10년 전 조회 1,531
10년 전 조회 1,602
10년 전 조회 1,652
10년 전 조회 1,638
10년 전 조회 1,807
10년 전 조회 1,578
10년 전 조회 1,600
10년 전 조회 1,609
10년 전 조회 1,518
10년 전 조회 1,577
10년 전 조회 1,389
10년 전 조회 1,467
10년 전 조회 1,370
10년 전 조회 1,530
10년 전 조회 1,474
10년 전 조회 1,944
10년 전 조회 1,412
10년 전 조회 1,382
10년 전 조회 1,643
10년 전 조회 1,443
10년 전 조회 1,417
10년 전 조회 1,419
10년 전 조회 1,365
10년 전 조회 1,301
10년 전 조회 1,276
10년 전 조회 1,392
10년 전 조회 1,360
10년 전 조회 1,318
10년 전 조회 1,202
10년 전 조회 1,286
10년 전 조회 1,272
10년 전 조회 1,295
10년 전 조회 1,347
10년 전 조회 1,337
10년 전 조회 1,292
10년 전 조회 1,287
10년 전 조회 1,319
10년 전 조회 1,304
10년 전 조회 1,382
10년 전 조회 1,296
10년 전 조회 1,246
10년 전 조회 1,231
10년 전 조회 1,253
10년 전 조회 1,255
10년 전 조회 1,256
10년 전 조회 1,272
10년 전 조회 1,224
10년 전 조회 1,290
10년 전 조회 1,223
10년 전 조회 1,321
10년 전 조회 1,410
10년 전 조회 1,380
10년 전 조회 1,314
10년 전 조회 1,240
10년 전 조회 1,360
10년 전 조회 1,260
10년 전 조회 1,300
10년 전 조회 1,252
10년 전 조회 1,218
10년 전 조회 1,212
10년 전 조회 1,237
10년 전 조회 1,314
10년 전 조회 1,267
10년 전 조회 1,344