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

· 10년 전 · 1050

<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,048
9년 전 조회 1,177
9년 전 조회 1,058
9년 전 조회 1,151
9년 전 조회 1,247
9년 전 조회 1,039
9년 전 조회 1,100
9년 전 조회 1,086
9년 전 조회 1,213
9년 전 조회 1,069
9년 전 조회 1,179
9년 전 조회 1,028
9년 전 조회 1,071
9년 전 조회 923
9년 전 조회 1,117
9년 전 조회 983
9년 전 조회 986
9년 전 조회 1,058
9년 전 조회 1,025
9년 전 조회 1,026
9년 전 조회 978
9년 전 조회 1,354
10년 전 조회 1,423
10년 전 조회 1,385
10년 전 조회 1,310
10년 전 조회 1,131
10년 전 조회 1,261
10년 전 조회 1,414
10년 전 조회 1,074
10년 전 조회 1,462
10년 전 조회 1,375
10년 전 조회 1,740
10년 전 조회 1,360
10년 전 조회 1,562
10년 전 조회 1,183
10년 전 조회 1,350
10년 전 조회 1,047
10년 전 조회 1,097
10년 전 조회 1,182
10년 전 조회 1,176
10년 전 조회 1,297
10년 전 조회 1,137
10년 전 조회 1,153
10년 전 조회 1,114
10년 전 조회 1,047
10년 전 조회 1,129
10년 전 조회 965
10년 전 조회 1,017
10년 전 조회 927
10년 전 조회 1,051
10년 전 조회 1,017
10년 전 조회 1,482
10년 전 조회 979
10년 전 조회 924
10년 전 조회 1,171
10년 전 조회 1,010
10년 전 조회 962
10년 전 조회 982
10년 전 조회 947
10년 전 조회 878
10년 전 조회 841
10년 전 조회 929
10년 전 조회 956
10년 전 조회 899
10년 전 조회 819
10년 전 조회 889
10년 전 조회 854
10년 전 조회 890
10년 전 조회 940
10년 전 조회 936
10년 전 조회 875
10년 전 조회 892
10년 전 조회 950
10년 전 조회 954
10년 전 조회 994
10년 전 조회 923
10년 전 조회 862
10년 전 조회 849
10년 전 조회 869
10년 전 조회 832
10년 전 조회 858
10년 전 조회 895
10년 전 조회 839
10년 전 조회 884
10년 전 조회 857
10년 전 조회 943
10년 전 조회 1,051
10년 전 조회 1,005
10년 전 조회 947
10년 전 조회 866
10년 전 조회 974
10년 전 조회 884
10년 전 조회 917
10년 전 조회 875
10년 전 조회 856
10년 전 조회 847
10년 전 조회 879
10년 전 조회 975
10년 전 조회 908
10년 전 조회 1,000