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

· 10년 전 · 1475

<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,531
9년 전 조회 1,635
9년 전 조회 1,573
9년 전 조회 1,623
10년 전 조회 1,719
10년 전 조회 1,525
10년 전 조회 1,534
10년 전 조회 1,554
10년 전 조회 1,691
10년 전 조회 1,534
10년 전 조회 1,636
10년 전 조회 1,465
10년 전 조회 1,547
10년 전 조회 1,366
10년 전 조회 1,586
10년 전 조회 1,395
10년 전 조회 1,428
10년 전 조회 1,540
10년 전 조회 1,436
10년 전 조회 1,472
10년 전 조회 1,407
10년 전 조회 1,819
10년 전 조회 1,841
10년 전 조회 1,812
10년 전 조회 1,780
10년 전 조회 1,552
10년 전 조회 1,681
10년 전 조회 1,854
10년 전 조회 1,563
10년 전 조회 1,844
10년 전 조회 1,821
10년 전 조회 2,195
10년 전 조회 1,803
10년 전 조회 1,998
10년 전 조회 1,638
10년 전 조회 1,781
10년 전 조회 1,484
10년 전 조회 1,547
10년 전 조회 1,606
10년 전 조회 1,592
10년 전 조회 1,748
10년 전 조회 1,517
10년 전 조회 1,548
10년 전 조회 1,533
10년 전 조회 1,454
10년 전 조회 1,529
10년 전 조회 1,338
10년 전 조회 1,409
10년 전 조회 1,314
10년 전 조회 1,476
10년 전 조회 1,407
10년 전 조회 1,890
10년 전 조회 1,353
10년 전 조회 1,314
10년 전 조회 1,577
10년 전 조회 1,384
10년 전 조회 1,363
10년 전 조회 1,356
10년 전 조회 1,304
10년 전 조회 1,232
10년 전 조회 1,208
10년 전 조회 1,311
10년 전 조회 1,305
10년 전 조회 1,244
10년 전 조회 1,135
10년 전 조회 1,221
10년 전 조회 1,205
10년 전 조회 1,213
10년 전 조회 1,272
10년 전 조회 1,272
10년 전 조회 1,216
10년 전 조회 1,216
10년 전 조회 1,258
10년 전 조회 1,233
10년 전 조회 1,317
10년 전 조회 1,227
10년 전 조회 1,182
10년 전 조회 1,163
10년 전 조회 1,178
10년 전 조회 1,159
10년 전 조회 1,185
10년 전 조회 1,195
10년 전 조회 1,163
10년 전 조회 1,231
10년 전 조회 1,163
10년 전 조회 1,252
10년 전 조회 1,336
10년 전 조회 1,314
10년 전 조회 1,262
10년 전 조회 1,179
10년 전 조회 1,295
10년 전 조회 1,200
10년 전 조회 1,221
10년 전 조회 1,185
10년 전 조회 1,149
10년 전 조회 1,153
10년 전 조회 1,172
10년 전 조회 1,262
10년 전 조회 1,201
10년 전 조회 1,281