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

· 10년 전 · 1073

<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,072
9년 전 조회 1,192
9년 전 조회 1,072
9년 전 조회 1,174
9년 전 조회 1,274
9년 전 조회 1,062
9년 전 조회 1,119
9년 전 조회 1,111
9년 전 조회 1,237
9년 전 조회 1,090
9년 전 조회 1,198
9년 전 조회 1,044
9년 전 조회 1,098
9년 전 조회 947
9년 전 조회 1,140
9년 전 조회 1,003
9년 전 조회 1,005
9년 전 조회 1,077
9년 전 조회 1,044
9년 전 조회 1,050
9년 전 조회 993
9년 전 조회 1,378
10년 전 조회 1,447
10년 전 조회 1,407
10년 전 조회 1,333
10년 전 조회 1,146
10년 전 조회 1,285
10년 전 조회 1,433
10년 전 조회 1,091
10년 전 조회 1,476
10년 전 조회 1,395
10년 전 조회 1,763
10년 전 조회 1,376
10년 전 조회 1,580
10년 전 조회 1,212
10년 전 조회 1,366
10년 전 조회 1,072
10년 전 조회 1,119
10년 전 조회 1,202
10년 전 조회 1,198
10년 전 조회 1,316
10년 전 조회 1,152
10년 전 조회 1,175
10년 전 조회 1,131
10년 전 조회 1,067
10년 전 조회 1,148
10년 전 조회 987
10년 전 조회 1,037
10년 전 조회 949
10년 전 조회 1,074
10년 전 조회 1,036
10년 전 조회 1,495
10년 전 조회 995
10년 전 조회 944
10년 전 조회 1,186
10년 전 조회 1,021
10년 전 조회 987
10년 전 조회 1,000
10년 전 조회 966
10년 전 조회 897
10년 전 조회 862
10년 전 조회 944
10년 전 조회 975
10년 전 조회 913
10년 전 조회 829
10년 전 조회 901
10년 전 조회 862
10년 전 조회 903
10년 전 조회 951
10년 전 조회 950
10년 전 조회 884
10년 전 조회 898
10년 전 조회 963
10년 전 조회 966
10년 전 조회 1,005
10년 전 조회 932
10년 전 조회 873
10년 전 조회 863
10년 전 조회 881
10년 전 조회 844
10년 전 조회 869
10년 전 조회 908
10년 전 조회 853
10년 전 조회 901
10년 전 조회 869
10년 전 조회 955
10년 전 조회 1,061
10년 전 조회 1,017
10년 전 조회 960
10년 전 조회 882
10년 전 조회 984
10년 전 조회 898
10년 전 조회 928
10년 전 조회 891
10년 전 조회 872
10년 전 조회 865
10년 전 조회 889
10년 전 조회 985
10년 전 조회 924
10년 전 조회 1,014