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

Automatically Jumping To The Next Field

· 20년 전 · 2763
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>

댓글 작성

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

로그인하기

게시글 목록

번호 제목
355
352
351
350
349
348
347
346
345
344
343
342
341
340
339
338
337
336
335
JavaScript atd 데몬
333
JavaScript portmap
332
331
330
329
328
325
323
322
321
320