테스트 사이트 - 개발 중인 베타 버전입니다

엔터치면 다음칸으로 이동.

<html>
<head>
    <title>다음칸</title>
<script language='javascript'>

   var is_submit = true;
   var _NEXT_FOCUS = ""; // 커서가 갈 곳..

   function check_form(){

       f = document.form;

      if(is_submit == true){
         return true;
      }else{
         f[_NEXT_FOCUS].focus();
         is_submit = true;
         return false;
     }
   }

   function next_input(next_focus){
     if(event.keyCode == 13){
          is_submit = false;
         _NEXT_FOCUS = next_focus;
      }
   }

</script>


<body>
입력폼 아무곳에서나 엔터키를 쳐보세요..

<form name='form'>
   <input type='text' size=20 name='put1' onKeyDown="next_input('put2');"><br>
   <input type='text' size=20 name='put2' onKeyDown="next_input('put3');"><br>
   <input type='text' size=20 name='put3' onKeyDown="next_input('put4');"><br>
   <input type='text' size=20 name='put4' onKeyDown="next_input('put5');"><br>
   <input type='text' size=20 name='put5' onKeyDown="next_input('put1');"><br>
   <input type='submit' value='보내기' onClick='return check_form();'>
</form>

</body>
</html>
[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]

댓글 작성

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

로그인하기

댓글 3개

게시글 목록

번호 제목
21248
13844
529
13842
526
29537
518
502
13840
25293
21244
29532
25288
29531
500
13836
21241
495
13832
25283
21236
13830
490
21220
21217
25277
25276
25275
484
13827
13825
13819
29529
13813
479
21211
25273
478
21201
25272
21189
477
476
21185
474
21181
21175
472
470
469
467
465
21168
25267
463
21164
21161
458
21146
457
13807
454
29528
451
447
21127
21122
25262
25254
21119
25251
25243
25239
21112
442
21103
25233
25222
25230
441
21100
25215
21097
21091
25212
25210
25209
21083
21080
439
438
436
25200
21066
25195
21055
21051
25192
21040
13803