TAB / MOVE FOCUS

Discussion in 'ASP General' started by Jay Villa, Aug 22, 2005.

  1. Jay Villa

    Jay Villa Guest

    I have a SSN Field which include 3 text boxes. How do I move the focus from
    one box to another as soon as user enter the max characters in the text box.
    For example:
    when users enter 123 in the first text box of ssn
    control should move to next text box .....

    -Thanks
    Jay
     
    Jay Villa, Aug 22, 2005
    #1
    1. Advertising

  2. Jay Villa

    McKirahan Guest

    "Jay Villa" <> wrote in message
    news:...
    > I have a SSN Field which include 3 text boxes. How do I move the focus

    from
    > one box to another as soon as user enter the max characters in the text

    box.
    > For example:
    > when users enter 123 in the first text box of ssn
    > control should move to next text box .....
    >
    > -Thanks
    > Jay


    This isn't an ASP (server-side) question.

    Here's a client-side JavaScript solution:

    <form>
    <input type="text" name="ssn1" id="ssn1"
    size="3" maxlength="3"
    onkeyup="if (this.value.length == 3)
    document.getElementById('ssn2').focus();">
    <input type="text" name="ssn2" id="ssn2"
    size="2" maxlength="2"
    onkeyup="if (this.value.length == 2)
    document.getElementById('ssn3').focus();">
    <input type="text" name="ssn3" id="ssn3"
    size="4" maxlength="4"
    onkeyup="if (this.value.length == 4)
    document.getElementById('butt').focus();">
    <input type="button" name="butt" value="">
    </form>
     
    McKirahan, Aug 22, 2005
    #2
    1. Advertising

  3. Jay Villa

    Jay Villa Guest

    Thanks McKirahan

    "McKirahan" <> wrote in message
    news:...
    > "Jay Villa" <> wrote in message
    > news:...
    >> I have a SSN Field which include 3 text boxes. How do I move the focus

    > from
    >> one box to another as soon as user enter the max characters in the text

    > box.
    >> For example:
    >> when users enter 123 in the first text box of ssn
    >> control should move to next text box .....
    >>
    >> -Thanks
    >> Jay

    >
    > This isn't an ASP (server-side) question.
    >
    > Here's a client-side JavaScript solution:
    >
    > <form>
    > <input type="text" name="ssn1" id="ssn1"
    > size="3" maxlength="3"
    > onkeyup="if (this.value.length == 3)
    > document.getElementById('ssn2').focus();">
    > <input type="text" name="ssn2" id="ssn2"
    > size="2" maxlength="2"
    > onkeyup="if (this.value.length == 2)
    > document.getElementById('ssn3').focus();">
    > <input type="text" name="ssn3" id="ssn3"
    > size="4" maxlength="4"
    > onkeyup="if (this.value.length == 4)
    > document.getElementById('butt').focus();">
    > <input type="button" name="butt" value="">
    > </form>
    >
    >
     
    Jay Villa, Aug 22, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hermit Dave
    Replies:
    0
    Views:
    442
    Hermit Dave
    Jan 22, 2004
  2. News Sympatico
    Replies:
    0
    Views:
    312
    News Sympatico
    May 21, 2005
  3. Eduardo78
    Replies:
    0
    Views:
    258
    Eduardo78
    Nov 3, 2005
  4. Andrew Tomazos
    Replies:
    2
    Views:
    628
    Nobody
    Dec 12, 2011
  5. Roger
    Replies:
    3
    Views:
    336
Loading...

Share This Page