|
*** フォーカス自動移動
1つのBoxの入力が終わったら、次のBoxへフォーカスを移します。~
こういう細かいサポートって、結構重要だったりしますよね?
movefocus.htm
<script language="JavaScript"><!--
function moveFocus(own, nextElement) {
if (own.value.length == own.maxLength) {
nextElement.focus();
}
}
//--></script>
<form name="form1" method="get">
<input type="text" size="4" maxlength="4" name="input1"
onkeyup="moveFocus(this, this.form.input2);"><br />
<input type="text" size="4" maxlength="4" name="input2">
</form>