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

· 10년 전 · 1707

<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);'  >
 

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

프로그램

+
제목 글쓴이 날짜 조회
10년 전 조회 1,792
10년 전 조회 1,872
10년 전 조회 1,820
10년 전 조회 1,828
10년 전 조회 1,957
10년 전 조회 1,746
10년 전 조회 1,782
10년 전 조회 1,818
10년 전 조회 1,924
10년 전 조회 1,770
10년 전 조회 1,908
10년 전 조회 1,670
10년 전 조회 1,780
10년 전 조회 1,560
10년 전 조회 1,807
10년 전 조회 1,589
10년 전 조회 1,654
10년 전 조회 1,753
10년 전 조회 1,646
10년 전 조회 1,679
10년 전 조회 1,635
10년 전 조회 2,042
10년 전 조회 2,051
10년 전 조회 2,048
10년 전 조회 2,005
10년 전 조회 1,783
10년 전 조회 1,909
10년 전 조회 2,062
10년 전 조회 1,766
10년 전 조회 2,058
10년 전 조회 2,016
10년 전 조회 2,406
10년 전 조회 2,017
10년 전 조회 2,228
10년 전 조회 1,841
10년 전 조회 2,003
10년 전 조회 1,687
10년 전 조회 1,776
10년 전 조회 1,804
10년 전 조회 1,815
10년 전 조회 1,979
10년 전 조회 1,746
10년 전 조회 1,773
10년 전 조회 1,789
10년 전 조회 1,688
10년 전 조회 1,745
10년 전 조회 1,551
10년 전 조회 1,627
10년 전 조회 1,538
10년 전 조회 1,708
10년 전 조회 1,646
10년 전 조회 2,120
10년 전 조회 1,594
10년 전 조회 1,554
10년 전 조회 1,823
10년 전 조회 1,631
10년 전 조회 1,581
10년 전 조회 1,592
10년 전 조회 1,558
10년 전 조회 1,474
10년 전 조회 1,454
10년 전 조회 1,567
10년 전 조회 1,534
10년 전 조회 1,495
10년 전 조회 1,389
10년 전 조회 1,454
10년 전 조회 1,497
10년 전 조회 1,468
10년 전 조회 1,538
10년 전 조회 1,507
10년 전 조회 1,477
10년 전 조회 1,472
10년 전 조회 1,515
10년 전 조회 1,487
10년 전 조회 1,572
10년 전 조회 1,477
10년 전 조회 1,429
10년 전 조회 1,407
10년 전 조회 1,431
10년 전 조회 1,456
10년 전 조회 1,441
10년 전 조회 1,469
10년 전 조회 1,409
10년 전 조회 1,480
10년 전 조회 1,426
10년 전 조회 1,509
10년 전 조회 1,597
10년 전 조회 1,577
10년 전 조회 1,503
10년 전 조회 1,423
10년 전 조회 1,569
10년 전 조회 1,465
10년 전 조회 1,499
10년 전 조회 1,442
10년 전 조회 1,434
10년 전 조회 1,421
10년 전 조회 1,448
10년 전 조회 1,551
10년 전 조회 1,472
10년 전 조회 1,557