Auto Tab Form Fields using JavaScript:
This a simple sample code for auto tab form fields using javascript. It works in conjunction with the "maxlength" attribute of HTML, triggered whenever the user's input reaches the maxlength's value.
Code:
Try this demo:
Enter your input:
This a simple sample code for auto tab form fields using javascript. It works in conjunction with the "maxlength" attribute of HTML, triggered whenever the user's input reaches the maxlength's value.
Code:
<script type="text/javascript"> /* Auto tabbing script http://dotnetcluster.blogspot.in/ */ function autoTab(current,next){ if (current.getAttribute&¤t.value.length==current.getAttribute("maxlength")) next.focus() } </script> <b>Enter your input:</b> <form name="fromAutoTab"> <input type="text" name="first" size="4" onkeyup="autoTab(this, document.fromAutoTab.second)" maxlength="3" /> <input type="text" name="second" size="4" onkeyup="autoTab(this, document.fromAutoTab.third)" maxlength="3" /> <input type="text" name="third" size="5" maxlength="4" /> </form>
Enter your input:
0 comments
Post a Comment