setting focus to textbox

Discussion in 'ASP .Net Building Controls' started by Tony Piperato, Oct 23, 2003.

  1. Hello,

    Can someone tell me if/how I can set the focus to a textbox so when the page
    loads the cursor is placed in the textbox and the user can just begin
    typing?

    Thanks.

    Pip
     
    Tony Piperato, Oct 23, 2003
    #1
    1. Advertising

  2. Hi Tony,

    Its pretty simple, you just need to output some javascript from the
    server-side to set the focus to the control you want, take a look at
    javascript's focus function. If I remember right, ScottGu[1] has posted a
    ppt with some tricks & tips (including the focus one).

    [1] http://weblogs.asp.net/scottgu

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx

    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup

    and not by private mail.
    "Tony Piperato" <> wrote in message
    news:u%...
    > Hello,
    >
    > Can someone tell me if/how I can set the focus to a textbox so when the

    page
    > loads the cursor is placed in the textbox and the user can just begin
    > typing?
    >
    > Thanks.
    >
    > Pip
    >
    >
     
    Victor Garcia Aprea [MVP], Oct 23, 2003
    #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. George Durzi

    Setting Focus on an asp:textbox

    George Durzi, Aug 20, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    597
    Marina
    Aug 20, 2003
  2. test test

    setting focus to a textbox

    test test, Aug 30, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,754
    Kevin Spencer
    Aug 30, 2003
  3. Jason
    Replies:
    4
    Views:
    1,629
    Jason
    May 7, 2007
  4. Replies:
    2
    Views:
    341
    Thomas 'PointedEars' Lahn
    Jun 6, 2005
  5. Roger
    Replies:
    3
    Views:
    329
Loading...

Share This Page