<html> <head> <script type="text/javascript"> function toUnicode(elmnt,content) { if (content.length==elmnt.maxLength) { next=elmnt.tabIndex if (next<document.forms[0].elements.length) { document.forms[0].elements[next].focus() } } } </script> </head> <body> <p>This script automatically jumps to the next input field when the current field's maxlength has been reached.</p> <form> <input size="3" tabindex="1" maxlength="3" onkeyup="toUnicode(this,this.value)"> <input size="3" tabindex="2" maxlength="3" onkeyup="toUnicode(this,this.value)"> <input size="3" tabindex="3" maxlength="3" onkeyup="toUnicode(this,this.value)"> </form> </body> </html>
Edit the text above, and click on the button to see the result.
Copyright © 2007-2008, Www.JavaBasics.We.Bs All rights reserved.