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>

관련자료

등록된 댓글이 없습니다.
Today's proverb
나무에게는 무엇이든 달라고 요구하는 뻔뻔한 친구가 아니라, 자신을 가꿔줄 친구들이 필요하다." (지금보다 더 나은 내가 되고 싶다중에서)