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

· 10년 전 · 1662

<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);'  >
 

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
10년 전 조회 1,741
10년 전 조회 1,821
10년 전 조회 1,774
10년 전 조회 1,778
10년 전 조회 1,911
10년 전 조회 1,707
10년 전 조회 1,726
10년 전 조회 1,760
10년 전 조회 1,877
10년 전 조회 1,719
10년 전 조회 1,858
10년 전 조회 1,622
10년 전 조회 1,728
10년 전 조회 1,524
10년 전 조회 1,767
10년 전 조회 1,542
10년 전 조회 1,612
10년 전 조회 1,713
10년 전 조회 1,601
10년 전 조회 1,645
10년 전 조회 1,591
10년 전 조회 1,994
10년 전 조회 2,003
10년 전 조회 1,993
10년 전 조회 1,968
10년 전 조회 1,744
10년 전 조회 1,862
10년 전 조회 2,021
10년 전 조회 1,722
10년 전 조회 2,009
10년 전 조회 1,983
10년 전 조회 2,365
10년 전 조회 1,969
10년 전 조회 2,197
10년 전 조회 1,794
10년 전 조회 1,954
10년 전 조회 1,648
10년 전 조회 1,735
10년 전 조회 1,768
10년 전 조회 1,780
10년 전 조회 1,933
10년 전 조회 1,710
10년 전 조회 1,738
10년 전 조회 1,747
10년 전 조회 1,655
10년 전 조회 1,709
10년 전 조회 1,521
10년 전 조회 1,593
10년 전 조회 1,511
10년 전 조회 1,663
10년 전 조회 1,609
10년 전 조회 2,084
10년 전 조회 1,562
10년 전 조회 1,519
10년 전 조회 1,782
10년 전 조회 1,592
10년 전 조회 1,555
10년 전 조회 1,555
10년 전 조회 1,523
10년 전 조회 1,444
10년 전 조회 1,424
10년 전 조회 1,537
10년 전 조회 1,508
10년 전 조회 1,460
10년 전 조회 1,352
10년 전 조회 1,423
10년 전 조회 1,460
10년 전 조회 1,446
10년 전 조회 1,509
10년 전 조회 1,477
10년 전 조회 1,439
10년 전 조회 1,437
10년 전 조회 1,483
10년 전 조회 1,453
10년 전 조회 1,542
10년 전 조회 1,447
10년 전 조회 1,397
10년 전 조회 1,374
10년 전 조회 1,399
10년 전 조회 1,414
10년 전 조회 1,416
10년 전 조회 1,436
10년 전 조회 1,377
10년 전 조회 1,452
10년 전 조회 1,385
10년 전 조회 1,481
10년 전 조회 1,564
10년 전 조회 1,543
10년 전 조회 1,467
10년 전 조회 1,396
10년 전 조회 1,541
10년 전 조회 1,436
10년 전 조회 1,472
10년 전 조회 1,413
10년 전 조회 1,398
10년 전 조회 1,387
10년 전 조회 1,416
10년 전 조회 1,514
10년 전 조회 1,429
10년 전 조회 1,522