Html & Script

주민번호 입력창에서 자동으로 이동

컨텐츠 정보

본문

주민번호 입력창을 만들 때
절반입력하고 나서
tab키 없이 자동으로 다음칸으로 넘어가는 기능은
어떻게 하면 만들 수 있나요??

-------------------------------------------------

<script language='javascript'>
function moveFocus(num,fromform,toform)
{
var str = fromform.value.length;
if(str == num)
toform.focus();
}
</script>

<form name=user>
<input class=txtinput1 type=text name=passport1 value='' size=6 maxlength=6 onKeyUp='moveFocus(6,this,this.form.passport2);'> -
<input class=txtinput1 type=text name=passport2 value='' size=7 maxlength=7>
</form>

관련자료

댓글 0
등록된 댓글이 없습니다.
Today's proverb
마음에 좋은 것과 좋은 바램으로 가득 채워라. 마음에 굳건한 신념만을 채운다면 이뤄지지 않을 것이 어디 있을까.