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

Automatically Jumping To The Next Field

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

댓글 작성

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

로그인하기

게시글 목록

번호 제목
10256
17572
17567
17796
10255
10254
10253
10252
10250
17566
10249
JavaScript getHtmlInfo
17793
17791
10246
17781
17767
17762
17761
17760
17757
17756
17753
10236
17747
10226