리자

Automatically Jumping To The Next Field

· 2005-04-26 (화) 09:14:39 · 1639
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,106
05-06-21 조회 5,812
05-06-20 조회 3,684
05-06-17 조회 5,025
05-06-17 조회 3,303
05-06-17 조회 3,644
bbbking
05-06-16 조회 7,939
bbbking
05-06-16 조회 5,895
05-06-15 조회 4,492
05-06-15 조회 4,042
05-05-04 조회 2,790
05-05-04 조회 2,740
05-05-04 조회 2,361
05-04-26 조회 1,640
05-04-24 조회 2,259
05-04-23 조회 3,684
05-04-20 조회 4,139
05-04-19 조회 1만
05-04-19 조회 5,059
05-04-14 조회 3,384
05-04-11 조회 3,191
05-04-11 조회 3,842
05-04-11 조회 2,074
05-04-11 조회 3,129
05-04-11 조회 3,328