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

· 10년 전 · 1455

<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,519
9년 전 조회 1,625
9년 전 조회 1,565
9년 전 조회 1,609
10년 전 조회 1,706
10년 전 조회 1,513
10년 전 조회 1,530
10년 전 조회 1,543
10년 전 조회 1,677
10년 전 조회 1,527
10년 전 조회 1,625
10년 전 조회 1,459
10년 전 조회 1,542
10년 전 조회 1,362
10년 전 조회 1,577
10년 전 조회 1,386
10년 전 조회 1,423
10년 전 조회 1,530
10년 전 조회 1,426
10년 전 조회 1,466
10년 전 조회 1,396
10년 전 조회 1,807
10년 전 조회 1,833
10년 전 조회 1,802
10년 전 조회 1,761
10년 전 조회 1,536
10년 전 조회 1,673
10년 전 조회 1,843
10년 전 조회 1,553
10년 전 조회 1,839
10년 전 조회 1,808
10년 전 조회 2,181
10년 전 조회 1,793
10년 전 조회 1,992
10년 전 조회 1,627
10년 전 조회 1,766
10년 전 조회 1,479
10년 전 조회 1,537
10년 전 조회 1,595
10년 전 조회 1,582
10년 전 조회 1,737
10년 전 조회 1,502
10년 전 조회 1,540
10년 전 조회 1,523
10년 전 조회 1,444
10년 전 조회 1,517
10년 전 조회 1,330
10년 전 조회 1,396
10년 전 조회 1,309
10년 전 조회 1,456
10년 전 조회 1,395
10년 전 조회 1,877
10년 전 조회 1,344
10년 전 조회 1,306
10년 전 조회 1,568
10년 전 조회 1,371
10년 전 조회 1,355
10년 전 조회 1,348
10년 전 조회 1,292
10년 전 조회 1,224
10년 전 조회 1,201
10년 전 조회 1,304
10년 전 조회 1,300
10년 전 조회 1,230
10년 전 조회 1,126
10년 전 조회 1,208
10년 전 조회 1,190
10년 전 조회 1,207
10년 전 조회 1,261
10년 전 조회 1,266
10년 전 조회 1,204
10년 전 조회 1,208
10년 전 조회 1,247
10년 전 조회 1,224
10년 전 조회 1,305
10년 전 조회 1,214
10년 전 조회 1,172
10년 전 조회 1,155
10년 전 조회 1,167
10년 전 조회 1,146
10년 전 조회 1,176
10년 전 조회 1,186
10년 전 조회 1,157
10년 전 조회 1,223
10년 전 조회 1,153
10년 전 조회 1,247
10년 전 조회 1,331
10년 전 조회 1,308
10년 전 조회 1,254
10년 전 조회 1,166
10년 전 조회 1,286
10년 전 조회 1,195
10년 전 조회 1,212
10년 전 조회 1,175
10년 전 조회 1,142
10년 전 조회 1,147
10년 전 조회 1,162
10년 전 조회 1,257
10년 전 조회 1,199
10년 전 조회 1,277