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

· 10년 전 · 1537

<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,588
10년 전 조회 1,679
10년 전 조회 1,623
10년 전 조회 1,657
10년 전 조회 1,765
10년 전 조회 1,562
10년 전 조회 1,578
10년 전 조회 1,610
10년 전 조회 1,735
10년 전 조회 1,582
10년 전 조회 1,698
10년 전 조회 1,504
10년 전 조회 1,590
10년 전 조회 1,407
10년 전 조회 1,627
10년 전 조회 1,426
10년 전 조회 1,472
10년 전 조회 1,578
10년 전 조회 1,485
10년 전 조회 1,516
10년 전 조회 1,444
10년 전 조회 1,856
10년 전 조회 1,883
10년 전 조회 1,860
10년 전 조회 1,828
10년 전 조회 1,603
10년 전 조회 1,730
10년 전 조회 1,900
10년 전 조회 1,608
10년 전 조회 1,881
10년 전 조회 1,861
10년 전 조회 2,237
10년 전 조회 1,844
10년 전 조회 2,052
10년 전 조회 1,684
10년 전 조회 1,830
10년 전 조회 1,534
10년 전 조회 1,603
10년 전 조회 1,654
10년 전 조회 1,640
10년 전 조회 1,811
10년 전 조회 1,578
10년 전 조회 1,602
10년 전 조회 1,614
10년 전 조회 1,520
10년 전 조회 1,581
10년 전 조회 1,392
10년 전 조회 1,470
10년 전 조회 1,377
10년 전 조회 1,538
10년 전 조회 1,476
10년 전 조회 1,947
10년 전 조회 1,414
10년 전 조회 1,387
10년 전 조회 1,643
10년 전 조회 1,445
10년 전 조회 1,420
10년 전 조회 1,422
10년 전 조회 1,368
10년 전 조회 1,304
10년 전 조회 1,279
10년 전 조회 1,396
10년 전 조회 1,362
10년 전 조회 1,319
10년 전 조회 1,204
10년 전 조회 1,290
10년 전 조회 1,277
10년 전 조회 1,299
10년 전 조회 1,349
10년 전 조회 1,341
10년 전 조회 1,295
10년 전 조회 1,291
10년 전 조회 1,326
10년 전 조회 1,309
10년 전 조회 1,386
10년 전 조회 1,301
10년 전 조회 1,250
10년 전 조회 1,232
10년 전 조회 1,255
10년 전 조회 1,259
10년 전 조회 1,260
10년 전 조회 1,276
10년 전 조회 1,230
10년 전 조회 1,294
10년 전 조회 1,224
10년 전 조회 1,324
10년 전 조회 1,414
10년 전 조회 1,382
10년 전 조회 1,320
10년 전 조회 1,242
10년 전 조회 1,365
10년 전 조회 1,263
10년 전 조회 1,306
10년 전 조회 1,254
10년 전 조회 1,220
10년 전 조회 1,217
10년 전 조회 1,239
10년 전 조회 1,319
10년 전 조회 1,273
10년 전 조회 1,349