리자

Automatically Jumping To The Next Field

· 2005-04-26 (화) 09:14:39 · 1636
var downStrokeField;
function autojump(fieldName,nextFieldName,fakeMaxLength)
{
var myForm=document.forms[document.forms.length - 1];
var myField=myForm.elements[fieldName];
myField.nextField=myForm.elements[nextFieldName];

if (myField.maxLength == null)
myField.maxLength=fakeMaxLength;

myField.onkeydown=autojump_keyDown;
myField.onkeyup=autojump_keyUp;
}

function autojump_keyDown()
{
this.beforeLength=this.value.length;
downStrokeField=this;
}

function autojump_keyUp()
{
if (
(this == downStrokeField) &&
(this.value.length > this.beforeLength) &&
(this.value.length >= this.maxLength)
)
{
if (this.nextField.select) this.nextField.select();
this.nextField.focus();
}
downStrokeField=null;
}<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>
|
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

6,077건

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
05-06-24 조회 5,104
05-06-21 조회 5,807
05-06-20 조회 3,679
05-06-17 조회 5,020
05-06-17 조회 3,297
05-06-17 조회 3,639
bbbking
05-06-16 조회 7,934
bbbking
05-06-16 조회 5,890
05-06-15 조회 4,488
05-06-15 조회 4,037
05-05-04 조회 2,785
05-05-04 조회 2,733
05-05-04 조회 2,357
05-04-26 조회 1,637
05-04-24 조회 2,254
05-04-23 조회 3,679
05-04-20 조회 4,134
05-04-19 조회 1만
05-04-19 조회 5,054
05-04-14 조회 3,381
05-04-11 조회 3,188
05-04-11 조회 3,839
05-04-11 조회 2,069
05-04-11 조회 3,125
05-04-11 조회 3,324