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

· 10년 전 · 1337

<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,420
9년 전 조회 1,512
9년 전 조회 1,439
9년 전 조회 1,499
9년 전 조회 1,594
9년 전 조회 1,417
9년 전 조회 1,445
9년 전 조회 1,439
9년 전 조회 1,551
9년 전 조회 1,419
10년 전 조회 1,534
10년 전 조회 1,372
10년 전 조회 1,443
10년 전 조회 1,260
10년 전 조회 1,494
10년 전 조회 1,307
10년 전 조회 1,318
10년 전 조회 1,416
10년 전 조회 1,345
10년 전 조회 1,359
10년 전 조회 1,281
10년 전 조회 1,696
10년 전 조회 1,737
10년 전 조회 1,714
10년 전 조회 1,645
10년 전 조회 1,442
10년 전 조회 1,581
10년 전 조회 1,723
10년 전 조회 1,409
10년 전 조회 1,718
10년 전 조회 1,695
10년 전 조회 2,072
10년 전 조회 1,666
10년 전 조회 1,895
10년 전 조회 1,521
10년 전 조회 1,639
10년 전 조회 1,370
10년 전 조회 1,424
10년 전 조회 1,495
10년 전 조회 1,493
10년 전 조회 1,625
10년 전 조회 1,401
10년 전 조회 1,429
10년 전 조회 1,385
10년 전 조회 1,344
10년 전 조회 1,406
10년 전 조회 1,236
10년 전 조회 1,286
10년 전 조회 1,197
10년 전 조회 1,338
10년 전 조회 1,285
10년 전 조회 1,763
10년 전 조회 1,241
10년 전 조회 1,209
10년 전 조회 1,452
10년 전 조회 1,266
10년 전 조회 1,230
10년 전 조회 1,240
10년 전 조회 1,186
10년 전 조회 1,112
10년 전 조회 1,110
10년 전 조회 1,203
10년 전 조회 1,205
10년 전 조회 1,129
10년 전 조회 1,024
10년 전 조회 1,111
10년 전 조회 1,079
10년 전 조회 1,107
10년 전 조회 1,160
10년 전 조회 1,154
10년 전 조회 1,097
10년 전 조회 1,112
10년 전 조회 1,161
10년 전 조회 1,118
10년 전 조회 1,195
10년 전 조회 1,133
10년 전 조회 1,065
10년 전 조회 1,049
10년 전 조회 1,064
10년 전 조회 1,046
10년 전 조회 1,074
10년 전 조회 1,103
10년 전 조회 1,053
10년 전 조회 1,126
10년 전 조회 1,056
10년 전 조회 1,167
10년 전 조회 1,247
10년 전 조회 1,208
10년 전 조회 1,159
10년 전 조회 1,073
10년 전 조회 1,190
10년 전 조회 1,102
10년 전 조회 1,138
10년 전 조회 1,079
10년 전 조회 1,060
10년 전 조회 1,061
10년 전 조회 1,086
10년 전 조회 1,187
10년 전 조회 1,124
10년 전 조회 1,210