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

· 10년 전 · 1323

<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,399
9년 전 조회 1,491
9년 전 조회 1,412
9년 전 조회 1,480
9년 전 조회 1,578
9년 전 조회 1,390
9년 전 조회 1,426
9년 전 조회 1,425
9년 전 조회 1,539
9년 전 조회 1,398
9년 전 조회 1,515
9년 전 조회 1,352
9년 전 조회 1,426
9년 전 조회 1,249
10년 전 조회 1,475
10년 전 조회 1,292
10년 전 조회 1,304
10년 전 조회 1,394
10년 전 조회 1,327
10년 전 조회 1,340
10년 전 조회 1,265
10년 전 조회 1,681
10년 전 조회 1,726
10년 전 조회 1,697
10년 전 조회 1,629
10년 전 조회 1,425
10년 전 조회 1,561
10년 전 조회 1,708
10년 전 조회 1,390
10년 전 조회 1,703
10년 전 조회 1,673
10년 전 조회 2,048
10년 전 조회 1,644
10년 전 조회 1,874
10년 전 조회 1,499
10년 전 조회 1,623
10년 전 조회 1,352
10년 전 조회 1,408
10년 전 조회 1,480
10년 전 조회 1,474
10년 전 조회 1,602
10년 전 조회 1,385
10년 전 조회 1,415
10년 전 조회 1,367
10년 전 조회 1,333
10년 전 조회 1,388
10년 전 조회 1,221
10년 전 조회 1,270
10년 전 조회 1,184
10년 전 조회 1,324
10년 전 조회 1,263
10년 전 조회 1,743
10년 전 조회 1,231
10년 전 조회 1,190
10년 전 조회 1,439
10년 전 조회 1,244
10년 전 조회 1,216
10년 전 조회 1,224
10년 전 조회 1,174
10년 전 조회 1,102
10년 전 조회 1,091
10년 전 조회 1,185
10년 전 조회 1,191
10년 전 조회 1,116
10년 전 조회 1,009
10년 전 조회 1,092
10년 전 조회 1,060
10년 전 조회 1,098
10년 전 조회 1,143
10년 전 조회 1,134
10년 전 조회 1,087
10년 전 조회 1,092
10년 전 조회 1,150
10년 전 조회 1,102
10년 전 조회 1,179
10년 전 조회 1,117
10년 전 조회 1,050
10년 전 조회 1,030
10년 전 조회 1,053
10년 전 조회 1,021
10년 전 조회 1,059
10년 전 조회 1,085
10년 전 조회 1,036
10년 전 조회 1,109
10년 전 조회 1,046
10년 전 조회 1,152
10년 전 조회 1,236
10년 전 조회 1,194
10년 전 조회 1,144
10년 전 조회 1,066
10년 전 조회 1,169
10년 전 조회 1,087
10년 전 조회 1,120
10년 전 조회 1,067
10년 전 조회 1,049
10년 전 조회 1,052
10년 전 조회 1,072
10년 전 조회 1,175
10년 전 조회 1,108
10년 전 조회 1,196