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

· 10년 전 · 1517

<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);'  >
 

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

태그 필터 (최대 3개) 전체 개발자 소스 기타 mysql 팁자료실 javascript php linux flash 정규표현식 jquery node.js mobile 웹서버 os 프로그램 강좌 썸네일 이미지관련 도로명주소 그누보드5 기획자 견적서 계약서 기획서 마케팅 제안서 seo 통계 서식 통계자료 퍼블리셔 html css 반응형 웹접근성 퍼블리싱 표준화 반응형웹 홈페이지기초 부트스트랩 angularjs 포럼 스크린리더 센스리더 개발자톡 개발자팁 퍼블리셔톡 퍼블리셔팁 기획자톡 기획자팁 프로그램강좌 퍼블리싱강좌
+
제목 글쓴이 날짜 조회
9년 전 조회 1,571
10년 전 조회 1,661
10년 전 조회 1,607
10년 전 조회 1,643
10년 전 조회 1,756
10년 전 조회 1,546
10년 전 조회 1,569
10년 전 조회 1,592
10년 전 조회 1,719
10년 전 조회 1,570
10년 전 조회 1,676
10년 전 조회 1,489
10년 전 조회 1,575
10년 전 조회 1,394
10년 전 조회 1,618
10년 전 조회 1,412
10년 전 조회 1,456
10년 전 조회 1,565
10년 전 조회 1,471
10년 전 조회 1,506
10년 전 조회 1,429
10년 전 조회 1,843
10년 전 조회 1,871
10년 전 조회 1,850
10년 전 조회 1,808
10년 전 조회 1,591
10년 전 조회 1,714
10년 전 조회 1,882
10년 전 조회 1,595
10년 전 조회 1,870
10년 전 조회 1,850
10년 전 조회 2,227
10년 전 조회 1,829
10년 전 조회 2,037
10년 전 조회 1,671
10년 전 조회 1,818
10년 전 조회 1,517
10년 전 조회 1,585
10년 전 조회 1,637
10년 전 조회 1,627
10년 전 조회 1,791
10년 전 조회 1,559
10년 전 조회 1,587
10년 전 조회 1,597
10년 전 조회 1,506
10년 전 조회 1,567
10년 전 조회 1,379
10년 전 조회 1,456
10년 전 조회 1,354
10년 전 조회 1,518
10년 전 조회 1,463
10년 전 조회 1,933
10년 전 조회 1,398
10년 전 조회 1,366
10년 전 조회 1,626
10년 전 조회 1,429
10년 전 조회 1,403
10년 전 조회 1,401
10년 전 조회 1,354
10년 전 조회 1,285
10년 전 조회 1,256
10년 전 조회 1,376
10년 전 조회 1,347
10년 전 조회 1,300
10년 전 조회 1,191
10년 전 조회 1,271
10년 전 조회 1,249
10년 전 조회 1,281
10년 전 조회 1,320
10년 전 조회 1,318
10년 전 조회 1,275
10년 전 조회 1,270
10년 전 조회 1,304
10년 전 조회 1,287
10년 전 조회 1,362
10년 전 조회 1,272
10년 전 조회 1,228
10년 전 조회 1,212
10년 전 조회 1,224
10년 전 조회 1,225
10년 전 조회 1,237
10년 전 조회 1,252
10년 전 조회 1,211
10년 전 조회 1,267
10년 전 조회 1,204
10년 전 조회 1,303
10년 전 조회 1,388
10년 전 조회 1,362
10년 전 조회 1,300
10년 전 조회 1,221
10년 전 조회 1,347
10년 전 조회 1,233
10년 전 조회 1,273
10년 전 조회 1,238
10년 전 조회 1,197
10년 전 조회 1,198
10년 전 조회 1,221
10년 전 조회 1,302
10년 전 조회 1,243
10년 전 조회 1,333