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

· 10년 전 · 1441

<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,506
9년 전 조회 1,615
9년 전 조회 1,549
9년 전 조회 1,598
9년 전 조회 1,699
9년 전 조회 1,506
10년 전 조회 1,522
10년 전 조회 1,536
10년 전 조회 1,668
10년 전 조회 1,515
10년 전 조회 1,619
10년 전 조회 1,450
10년 전 조회 1,529
10년 전 조회 1,349
10년 전 조회 1,573
10년 전 조회 1,382
10년 전 조회 1,413
10년 전 조회 1,519
10년 전 조회 1,416
10년 전 조회 1,453
10년 전 조회 1,386
10년 전 조회 1,796
10년 전 조회 1,823
10년 전 조회 1,793
10년 전 조회 1,752
10년 전 조회 1,526
10년 전 조회 1,661
10년 전 조회 1,826
10년 전 조회 1,536
10년 전 조회 1,829
10년 전 조회 1,795
10년 전 조회 2,172
10년 전 조회 1,778
10년 전 조회 1,982
10년 전 조회 1,608
10년 전 조회 1,748
10년 전 조회 1,463
10년 전 조회 1,521
10년 전 조회 1,584
10년 전 조회 1,572
10년 전 조회 1,726
10년 전 조회 1,492
10년 전 조회 1,525
10년 전 조회 1,504
10년 전 조회 1,431
10년 전 조회 1,498
10년 전 조회 1,316
10년 전 조회 1,383
10년 전 조회 1,299
10년 전 조회 1,442
10년 전 조회 1,385
10년 전 조회 1,857
10년 전 조회 1,329
10년 전 조회 1,294
10년 전 조회 1,553
10년 전 조회 1,366
10년 전 조회 1,343
10년 전 조회 1,336
10년 전 조회 1,274
10년 전 조회 1,211
10년 전 조회 1,190
10년 전 조회 1,292
10년 전 조회 1,286
10년 전 조회 1,220
10년 전 조회 1,116
10년 전 조회 1,197
10년 전 조회 1,179
10년 전 조회 1,196
10년 전 조회 1,251
10년 전 조회 1,254
10년 전 조회 1,193
10년 전 조회 1,198
10년 전 조회 1,238
10년 전 조회 1,213
10년 전 조회 1,289
10년 전 조회 1,204
10년 전 조회 1,159
10년 전 조회 1,141
10년 전 조회 1,159
10년 전 조회 1,135
10년 전 조회 1,159
10년 전 조회 1,178
10년 전 조회 1,151
10년 전 조회 1,208
10년 전 조회 1,143
10년 전 조회 1,237
10년 전 조회 1,322
10년 전 조회 1,295
10년 전 조회 1,245
10년 전 조회 1,159
10년 전 조회 1,277
10년 전 조회 1,191
10년 전 조회 1,199
10년 전 조회 1,166
10년 전 조회 1,135
10년 전 조회 1,138
10년 전 조회 1,154
10년 전 조회 1,252
10년 전 조회 1,193
10년 전 조회 1,271