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

· 10년 전 · 1316

<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,389
9년 전 조회 1,482
9년 전 조회 1,402
9년 전 조회 1,468
9년 전 조회 1,566
9년 전 조회 1,378
9년 전 조회 1,414
9년 전 조회 1,404
9년 전 조회 1,530
9년 전 조회 1,389
9년 전 조회 1,503
9년 전 조회 1,341
9년 전 조회 1,415
9년 전 조회 1,240
10년 전 조회 1,465
10년 전 조회 1,281
10년 전 조회 1,288
10년 전 조회 1,383
10년 전 조회 1,316
10년 전 조회 1,333
10년 전 조회 1,254
10년 전 조회 1,667
10년 전 조회 1,715
10년 전 조회 1,681
10년 전 조회 1,620
10년 전 조회 1,411
10년 전 조회 1,550
10년 전 조회 1,692
10년 전 조회 1,378
10년 전 조회 1,691
10년 전 조회 1,662
10년 전 조회 2,037
10년 전 조회 1,640
10년 전 조회 1,861
10년 전 조회 1,488
10년 전 조회 1,609
10년 전 조회 1,338
10년 전 조회 1,395
10년 전 조회 1,465
10년 전 조회 1,460
10년 전 조회 1,591
10년 전 조회 1,381
10년 전 조회 1,406
10년 전 조회 1,358
10년 전 조회 1,326
10년 전 조회 1,373
10년 전 조회 1,216
10년 전 조회 1,256
10년 전 조회 1,179
10년 전 조회 1,317
10년 전 조회 1,256
10년 전 조회 1,737
10년 전 조회 1,220
10년 전 조회 1,181
10년 전 조회 1,429
10년 전 조회 1,235
10년 전 조회 1,208
10년 전 조회 1,215
10년 전 조회 1,165
10년 전 조회 1,099
10년 전 조회 1,084
10년 전 조회 1,172
10년 전 조회 1,182
10년 전 조회 1,105
10년 전 조회 1,002
10년 전 조회 1,083
10년 전 조회 1,055
10년 전 조회 1,092
10년 전 조회 1,129
10년 전 조회 1,125
10년 전 조회 1,078
10년 전 조회 1,084
10년 전 조회 1,140
10년 전 조회 1,092
10년 전 조회 1,175
10년 전 조회 1,110
10년 전 조회 1,044
10년 전 조회 1,016
10년 전 조회 1,050
10년 전 조회 1,010
10년 전 조회 1,047
10년 전 조회 1,078
10년 전 조회 1,030
10년 전 조회 1,099
10년 전 조회 1,040
10년 전 조회 1,135
10년 전 조회 1,224
10년 전 조회 1,185
10년 전 조회 1,135
10년 전 조회 1,056
10년 전 조회 1,156
10년 전 조회 1,079
10년 전 조회 1,112
10년 전 조회 1,056
10년 전 조회 1,043
10년 전 조회 1,044
10년 전 조회 1,065
10년 전 조회 1,169
10년 전 조회 1,102
10년 전 조회 1,189