텍스트 박스 포커스 다음 입력칸으로 자동 이동
Programming 2007. 12. 5. 21:50
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>무제 문서</title>
</head>
<script>
//다음 칸으로 이동
function moveFocus(num,here,next){
var str = here.value.length;
if(str == num)
next.focus();
}
</script>
<body>
<FORM METHOD='POST' NAME='modify' ACTION=''>
<table width="921" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="917">
<input type="text" name="gve_date_from" value="20070401" SIZE='9' onFocus="this.select()" maxlength=8 onKeyPress="onlyNum()" onKeyUp="moveFocus(8,this,this.form.gve_date_to);"> ~
<input type="text" name="gve_date_to" value="20070401" SIZE='9' onFocus="this.select()" maxlength=8 onKeyPress="onlyNum()">
1. 마우스 텍스트 박스 클릭하면 전체 선택. 2. 8자리 입력하면 자동으로 다음 텍스트 박스로 커서 이동.
</td>
</tr>
<tr>
<td>
<INPUT TYPE='text' NAME='regnum1' SIZE='6' MaxLength='6' onKeyUp="moveFocus(6,this,this.form.regnum2);"> -
<INPUT TYPE='text' NAME='regnum2' SIZE='7' MaxLength='7' >
1. 주민번호 앞자리 6자리 입력 후 다음 입력칸으로 이동.
</td>
</tr>
</table>
</form>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>무제 문서</title>
</head>
<script>
//다음 칸으로 이동
function moveFocus(num,here,next){
var str = here.value.length;
if(str == num)
next.focus();
}
</script>
<body>
<FORM METHOD='POST' NAME='modify' ACTION=''>
<table width="921" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="917">
<input type="text" name="gve_date_from" value="20070401" SIZE='9' onFocus="this.select()" maxlength=8 onKeyPress="onlyNum()" onKeyUp="moveFocus(8,this,this.form.gve_date_to);"> ~
<input type="text" name="gve_date_to" value="20070401" SIZE='9' onFocus="this.select()" maxlength=8 onKeyPress="onlyNum()">
1. 마우스 텍스트 박스 클릭하면 전체 선택. 2. 8자리 입력하면 자동으로 다음 텍스트 박스로 커서 이동.
</td>
</tr>
<tr>
<td>
<INPUT TYPE='text' NAME='regnum1' SIZE='6' MaxLength='6' onKeyUp="moveFocus(6,this,this.form.regnum2);"> -
<INPUT TYPE='text' NAME='regnum2' SIZE='7' MaxLength='7' >
1. 주민번호 앞자리 6자리 입력 후 다음 입력칸으로 이동.
</td>
</tr>
</table>
</form>
</body>
</html>