Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: autotab

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    autotab

    hi,

    there has to be a few thousand of these scripts around.

    need to simply advance to next field after completion of field.

    thx.

    Bob P.

  • #2
    New Coder
    Join Date
    Jul 2002
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's a script for you to play around with.


    <script language="JavaScript">
    <!--
    function advance(currentField,nextField) {
    if (currentField.value.length == 3)
    document.myForm[nextField].select();
    //else currentField.select();
    }
    //-->
    </script>

    <form name="myForm">
    <input type="text" name="t1" maxlength="3" size="3" onclick="select()" onKeyUp="advance(t1,'t2')">
    <input type="text" name="t2" maxlength="3" size="3" onclick="select()" onKeyUp="advance(t2,'t3')">
    <input type="text" name="t3" maxlength="3" size="3" onclick="select()" onKeyUp="advance(t3,'t4')">
    <input type="text" name="t4" maxlength="3" size="3" onclick="select()" >
    </form>

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi,

    thx. works fine.

    B.P.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •