moving from form element to form element

Discussion in 'ASP .Net' started by Rod Snyder, May 29, 2004.

  1. Rod  Snyder

    Rod Snyder Guest

    I'm looking for a way that when a user enters the required information in a
    form text box, the cursor automatically moves to the next textbox (asp.net).
    Can this be done in ASP.NET or must it be done with client side javascript.
    If client side, does anyone know of an example to look at?
    Rod
    Rod Snyder, May 29, 2004
    #1
    1. Advertising

  2. Hi

    Client scripting issue...here is something to get you going hopefully
    <form>
    <input name="myInput1" onchange="doValidate(this,this.form.myInput2)">
    <input name="myInput2" onchange="doValidate(this,this.form.myInput3)">
    etc
    </form>

    function doValidate(elSrc,elFocusTo){
    if(elSrc.value == "blah") elFocusTo.focus();//Pretty basic check ;-)
    else
    {
    alert("Blah blah");
    elSrc.focus();
    }
    }

    Server:
    myInput1.Attributes.Add("onchange","doValidate(this,this.form.myInput2)");
    etc

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Visual: Scripting MVP 2000-2004
    http://www.icysoft.com/
    http://www.deus-x.com/ Instant e-commerce
    http://www.microsoft.com/technet/scriptcenter/
    Playground: http://213.190.104.211/ ( IE 5.5+ only )

    No matter where you go there you are
    ==============================
    "Rod Snyder" <> wrote in message
    news:...
    > I'm looking for a way that when a user enters the required information in
    > a
    > form text box, the cursor automatically moves to the next textbox
    > (asp.net).
    > Can this be done in ASP.NET or must it be done with client side
    > javascript.
    > If client side, does anyone know of an example to look at?
    > Rod
    >
    >
    Vidar Petursson, May 29, 2004
    #2
    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. linkswanted
    Replies:
    0
    Views:
    912
    linkswanted
    Dec 21, 2007
  2. linkswanted
    Replies:
    0
    Views:
    1,560
    linkswanted
    Jan 6, 2008
  3. linkswanted
    Replies:
    0
    Views:
    445
    linkswanted
    Jan 23, 2008
  4. linkswanted
    Replies:
    0
    Views:
    628
    linkswanted
    Jan 24, 2008
  5. matthias s
    Replies:
    0
    Views:
    159
    matthias s
    Sep 20, 2007
Loading...

Share This Page