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

· 10년 전 · 1451

<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,515
9년 전 조회 1,623
9년 전 조회 1,561
9년 전 조회 1,609
10년 전 조회 1,705
10년 전 조회 1,513
10년 전 조회 1,529
10년 전 조회 1,543
10년 전 조회 1,675
10년 전 조회 1,523
10년 전 조회 1,624
10년 전 조회 1,458
10년 전 조회 1,542
10년 전 조회 1,360
10년 전 조회 1,576
10년 전 조회 1,385
10년 전 조회 1,422
10년 전 조회 1,529
10년 전 조회 1,424
10년 전 조회 1,463
10년 전 조회 1,392
10년 전 조회 1,807
10년 전 조회 1,831
10년 전 조회 1,800
10년 전 조회 1,760
10년 전 조회 1,534
10년 전 조회 1,671
10년 전 조회 1,840
10년 전 조회 1,548
10년 전 조회 1,839
10년 전 조회 1,807
10년 전 조회 2,178
10년 전 조회 1,789
10년 전 조회 1,988
10년 전 조회 1,622
10년 전 조회 1,762
10년 전 조회 1,475
10년 전 조회 1,534
10년 전 조회 1,594
10년 전 조회 1,578
10년 전 조회 1,736
10년 전 조회 1,501
10년 전 조회 1,539
10년 전 조회 1,518
10년 전 조회 1,441
10년 전 조회 1,513
10년 전 조회 1,328
10년 전 조회 1,394
10년 전 조회 1,308
10년 전 조회 1,452
10년 전 조회 1,394
10년 전 조회 1,869
10년 전 조회 1,342
10년 전 조회 1,304
10년 전 조회 1,563
10년 전 조회 1,369
10년 전 조회 1,353
10년 전 조회 1,347
10년 전 조회 1,286
10년 전 조회 1,221
10년 전 조회 1,199
10년 전 조회 1,304
10년 전 조회 1,298
10년 전 조회 1,230
10년 전 조회 1,124
10년 전 조회 1,205
10년 전 조회 1,187
10년 전 조회 1,206
10년 전 조회 1,259
10년 전 조회 1,262
10년 전 조회 1,202
10년 전 조회 1,208
10년 전 조회 1,243
10년 전 조회 1,220
10년 전 조회 1,302
10년 전 조회 1,213
10년 전 조회 1,169
10년 전 조회 1,152
10년 전 조회 1,165
10년 전 조회 1,144
10년 전 조회 1,173
10년 전 조회 1,185
10년 전 조회 1,155
10년 전 조회 1,220
10년 전 조회 1,151
10년 전 조회 1,246
10년 전 조회 1,330
10년 전 조회 1,307
10년 전 조회 1,251
10년 전 조회 1,166
10년 전 조회 1,283
10년 전 조회 1,193
10년 전 조회 1,211
10년 전 조회 1,174
10년 전 조회 1,141
10년 전 조회 1,146
10년 전 조회 1,159
10년 전 조회 1,256
10년 전 조회 1,198
10년 전 조회 1,275