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

· 10년 전 · 1227

<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,303
9년 전 조회 1,395
9년 전 조회 1,303
9년 전 조회 1,380
9년 전 조회 1,478
9년 전 조회 1,276
9년 전 조회 1,328
9년 전 조회 1,317
9년 전 조회 1,454
9년 전 조회 1,301
9년 전 조회 1,417
9년 전 조회 1,243
9년 전 조회 1,328
9년 전 조회 1,161
9년 전 조회 1,374
9년 전 조회 1,226
9년 전 조회 1,217
9년 전 조회 1,285
9년 전 조회 1,235
9년 전 조회 1,265
9년 전 조회 1,189
10년 전 조회 1,582
10년 전 조회 1,644
10년 전 조회 1,602
10년 전 조회 1,542
10년 전 조회 1,329
10년 전 조회 1,474
10년 전 조회 1,624
10년 전 조회 1,309
10년 전 조회 1,623
10년 전 조회 1,592
10년 전 조회 1,958
10년 전 조회 1,571
10년 전 조회 1,788
10년 전 조회 1,405
10년 전 조회 1,549
10년 전 조회 1,267
10년 전 조회 1,314
10년 전 조회 1,391
10년 전 조회 1,385
10년 전 조회 1,511
10년 전 조회 1,304
10년 전 조회 1,339
10년 전 조회 1,292
10년 전 조회 1,260
10년 전 조회 1,305
10년 전 조회 1,151
10년 전 조회 1,202
10년 전 조회 1,112
10년 전 조회 1,228
10년 전 조회 1,206
10년 전 조회 1,675
10년 전 조회 1,158
10년 전 조회 1,109
10년 전 조회 1,361
10년 전 조회 1,170
10년 전 조회 1,140
10년 전 조회 1,149
10년 전 조회 1,109
10년 전 조회 1,046
10년 전 조회 1,026
10년 전 조회 1,098
10년 전 조회 1,119
10년 전 조회 1,046
10년 전 조회 960
10년 전 조회 1,037
10년 전 조회 989
10년 전 조회 1,042
10년 전 조회 1,071
10년 전 조회 1,073
10년 전 조회 1,016
10년 전 조회 1,026
10년 전 조회 1,092
10년 전 조회 1,046
10년 전 조회 1,112
10년 전 조회 1,060
10년 전 조회 1,003
10년 전 조회 967
10년 전 조회 994
10년 전 조회 956
10년 전 조회 997
10년 전 조회 1,029
10년 전 조회 980
10년 전 조회 1,041
10년 전 조회 999
10년 전 조회 1,083
10년 전 조회 1,172
10년 전 조회 1,137
10년 전 조회 1,087
10년 전 조회 1,011
10년 전 조회 1,110
10년 전 조회 1,040
10년 전 조회 1,061
10년 전 조회 1,011
10년 전 조회 1,000
10년 전 조회 991
10년 전 조회 1,013
10년 전 조회 1,128
10년 전 조회 1,062
10년 전 조회 1,140