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

· 10년 전 · 1436

<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,498
9년 전 조회 1,609
9년 전 조회 1,543
9년 전 조회 1,593
9년 전 조회 1,697
9년 전 조회 1,503
10년 전 조회 1,517
10년 전 조회 1,533
10년 전 조회 1,661
10년 전 조회 1,513
10년 전 조회 1,617
10년 전 조회 1,445
10년 전 조회 1,524
10년 전 조회 1,344
10년 전 조회 1,569
10년 전 조회 1,380
10년 전 조회 1,409
10년 전 조회 1,514
10년 전 조회 1,414
10년 전 조회 1,448
10년 전 조회 1,379
10년 전 조회 1,792
10년 전 조회 1,822
10년 전 조회 1,792
10년 전 조회 1,746
10년 전 조회 1,523
10년 전 조회 1,657
10년 전 조회 1,823
10년 전 조회 1,532
10년 전 조회 1,822
10년 전 조회 1,788
10년 전 조회 2,168
10년 전 조회 1,776
10년 전 조회 1,976
10년 전 조회 1,606
10년 전 조회 1,745
10년 전 조회 1,458
10년 전 조회 1,520
10년 전 조회 1,580
10년 전 조회 1,568
10년 전 조회 1,723
10년 전 조회 1,488
10년 전 조회 1,519
10년 전 조회 1,498
10년 전 조회 1,431
10년 전 조회 1,491
10년 전 조회 1,311
10년 전 조회 1,376
10년 전 조회 1,290
10년 전 조회 1,437
10년 전 조회 1,376
10년 전 조회 1,851
10년 전 조회 1,322
10년 전 조회 1,291
10년 전 조회 1,550
10년 전 조회 1,362
10년 전 조회 1,341
10년 전 조회 1,335
10년 전 조회 1,271
10년 전 조회 1,206
10년 전 조회 1,188
10년 전 조회 1,289
10년 전 조회 1,283
10년 전 조회 1,216
10년 전 조회 1,113
10년 전 조회 1,194
10년 전 조회 1,175
10년 전 조회 1,194
10년 전 조회 1,248
10년 전 조회 1,249
10년 전 조회 1,188
10년 전 조회 1,191
10년 전 조회 1,236
10년 전 조회 1,209
10년 전 조회 1,282
10년 전 조회 1,200
10년 전 조회 1,154
10년 전 조회 1,137
10년 전 조회 1,154
10년 전 조회 1,133
10년 전 조회 1,156
10년 전 조회 1,174
10년 전 조회 1,147
10년 전 조회 1,204
10년 전 조회 1,138
10년 전 조회 1,233
10년 전 조회 1,319
10년 전 조회 1,292
10년 전 조회 1,241
10년 전 조회 1,154
10년 전 조회 1,274
10년 전 조회 1,189
10년 전 조회 1,197
10년 전 조회 1,164
10년 전 조회 1,130
10년 전 조회 1,135
10년 전 조회 1,152
10년 전 조회 1,249
10년 전 조회 1,190
10년 전 조회 1,271