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

· 10년 전 · 1577

<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,620
10년 전 조회 1,709
10년 전 조회 1,651
10년 전 조회 1,670
10년 전 조회 1,796
10년 전 조회 1,592
10년 전 조회 1,595
10년 전 조회 1,647
10년 전 조회 1,768
10년 전 조회 1,608
10년 전 조회 1,730
10년 전 조회 1,533
10년 전 조회 1,616
10년 전 조회 1,427
10년 전 조회 1,656
10년 전 조회 1,456
10년 전 조회 1,504
10년 전 조회 1,612
10년 전 조회 1,512
10년 전 조회 1,550
10년 전 조회 1,478
10년 전 조회 1,884
10년 전 조회 1,904
10년 전 조회 1,893
10년 전 조회 1,853
10년 전 조회 1,641
10년 전 조회 1,757
10년 전 조회 1,932
10년 전 조회 1,636
10년 전 조회 1,917
10년 전 조회 1,888
10년 전 조회 2,267
10년 전 조회 1,874
10년 전 조회 2,080
10년 전 조회 1,698
10년 전 조회 1,867
10년 전 조회 1,558
10년 전 조회 1,640
10년 전 조회 1,681
10년 전 조회 1,680
10년 전 조회 1,850
10년 전 조회 1,612
10년 전 조회 1,642
10년 전 조회 1,652
10년 전 조회 1,558
10년 전 조회 1,616
10년 전 조회 1,433
10년 전 조회 1,511
10년 전 조회 1,421
10년 전 조회 1,578
10년 전 조회 1,521
10년 전 조회 1,985
10년 전 조회 1,446
10년 전 조회 1,425
10년 전 조회 1,687
10년 전 조회 1,479
10년 전 조회 1,450
10년 전 조회 1,459
10년 전 조회 1,412
10년 전 조회 1,344
10년 전 조회 1,314
10년 전 조회 1,434
10년 전 조회 1,401
10년 전 조회 1,359
10년 전 조회 1,244
10년 전 조회 1,325
10년 전 조회 1,332
10년 전 조회 1,344
10년 전 조회 1,390
10년 전 조회 1,377
10년 전 조회 1,326
10년 전 조회 1,328
10년 전 조회 1,373
10년 전 조회 1,348
10년 전 조회 1,435
10년 전 조회 1,345
10년 전 조회 1,303
10년 전 조회 1,276
10년 전 조회 1,297
10년 전 조회 1,309
10년 전 조회 1,305
10년 전 조회 1,329
10년 전 조회 1,272
10년 전 조회 1,332
10년 전 조회 1,274
10년 전 조회 1,375
10년 전 조회 1,461
10년 전 조회 1,430
10년 전 조회 1,363
10년 전 조회 1,279
10년 전 조회 1,407
10년 전 조회 1,304
10년 전 조회 1,355
10년 전 조회 1,300
10년 전 조회 1,266
10년 전 조회 1,254
10년 전 조회 1,287
10년 전 조회 1,368
10년 전 조회 1,309
10년 전 조회 1,393