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

· 10년 전 · 1311

<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,386
9년 전 조회 1,478
9년 전 조회 1,398
9년 전 조회 1,465
9년 전 조회 1,562
9년 전 조회 1,376
9년 전 조회 1,410
9년 전 조회 1,398
9년 전 조회 1,527
9년 전 조회 1,389
9년 전 조회 1,500
9년 전 조회 1,341
9년 전 조회 1,413
9년 전 조회 1,237
10년 전 조회 1,461
10년 전 조회 1,280
10년 전 조회 1,287
10년 전 조회 1,382
10년 전 조회 1,312
10년 전 조회 1,333
10년 전 조회 1,251
10년 전 조회 1,662
10년 전 조회 1,714
10년 전 조회 1,678
10년 전 조회 1,619
10년 전 조회 1,408
10년 전 조회 1,546
10년 전 조회 1,689
10년 전 조회 1,375
10년 전 조회 1,687
10년 전 조회 1,660
10년 전 조회 2,037
10년 전 조회 1,637
10년 전 조회 1,860
10년 전 조회 1,485
10년 전 조회 1,605
10년 전 조회 1,337
10년 전 조회 1,392
10년 전 조회 1,462
10년 전 조회 1,454
10년 전 조회 1,589
10년 전 조회 1,376
10년 전 조회 1,402
10년 전 조회 1,357
10년 전 조회 1,324
10년 전 조회 1,368
10년 전 조회 1,215
10년 전 조회 1,253
10년 전 조회 1,177
10년 전 조회 1,312
10년 전 조회 1,256
10년 전 조회 1,735
10년 전 조회 1,217
10년 전 조회 1,178
10년 전 조회 1,426
10년 전 조회 1,232
10년 전 조회 1,207
10년 전 조회 1,214
10년 전 조회 1,163
10년 전 조회 1,099
10년 전 조회 1,082
10년 전 조회 1,168
10년 전 조회 1,178
10년 전 조회 1,104
10년 전 조회 1,001
10년 전 조회 1,082
10년 전 조회 1,054
10년 전 조회 1,090
10년 전 조회 1,128
10년 전 조회 1,122
10년 전 조회 1,076
10년 전 조회 1,082
10년 전 조회 1,138
10년 전 조회 1,087
10년 전 조회 1,171
10년 전 조회 1,109
10년 전 조회 1,044
10년 전 조회 1,015
10년 전 조회 1,048
10년 전 조회 1,004
10년 전 조회 1,047
10년 전 조회 1,077
10년 전 조회 1,028
10년 전 조회 1,095
10년 전 조회 1,040
10년 전 조회 1,130
10년 전 조회 1,222
10년 전 조회 1,183
10년 전 조회 1,130
10년 전 조회 1,055
10년 전 조회 1,155
10년 전 조회 1,078
10년 전 조회 1,111
10년 전 조회 1,055
10년 전 조회 1,040
10년 전 조회 1,043
10년 전 조회 1,064
10년 전 조회 1,169
10년 전 조회 1,100
10년 전 조회 1,186