리자

Automatically Jumping To The Next Field

· 2005-04-26 (화) 09:14:39 · 1647
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,110
05-06-21 조회 5,819
05-06-20 조회 3,692
05-06-17 조회 5,030
05-06-17 조회 3,310
05-06-17 조회 3,648
bbbking
05-06-16 조회 7,942
bbbking
05-06-16 조회 5,902
05-06-15 조회 4,496
05-06-15 조회 4,053
05-05-04 조회 2,806
05-05-04 조회 2,750
05-05-04 조회 2,371
05-04-26 조회 1,648
05-04-24 조회 2,265
05-04-23 조회 3,688
05-04-20 조회 4,145
05-04-19 조회 1만
05-04-19 조회 5,060
05-04-14 조회 3,391
05-04-11 조회 3,194
05-04-11 조회 3,851
05-04-11 조회 2,082
05-04-11 조회 3,138
05-04-11 조회 3,335