
Nov 29th, 2006, 14:59
|
 |
Moderator
|
|
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,763
Thanks: 0
Thanked 18 Times in 18 Posts
|
|
|
Auto tab bvetween inputs
- Code: Select all
<HTML>
<head>
<script language="JavaScript"><!--
function KeyPress(what,e,max,action) {
if (document.layers) {
if (e.target.value.length >= max)
eval(action);
}
else if (document.all) {
if (what.value.length > (max-1))
eval(action);
}
}
//--></script>
</head>
<body>
<form>
<input type="text" name="text1" size="1" maxlength="1" onKeyUp="KeyPress(this,event,1,'what.form.text2.focus()')">
- <input type="text" name="text2" size="2" maxlength="2" onKeyUp="KeyPress(this,event,2,'what.form.text3.focus()')">
- <input type="text" name="text3" size="3" maxlength="3" onKeyUp="KeyPress(this,event,3,'what.form.text4.focus()')">
- <input type="text" name="text4" size="4" maxlength="4" onKeyUp="KeyPress(this,event,4,'what.form.text5.focus()')">
- <input type="text" name="text5" size="5" maxlength="5" onKeyUp="KeyPress(this,event,5,'what.form.text6.focus()')">
- <input type="text" name="text6" size="6" maxlength="6" onKeyUp="KeyPress(this,event,5,'what.form.text6.focus()')">
</form>
</body>
</ HTML>
|