How to select text in textboxs by clicking on it?

Discussion in 'ASP .Net' started by Lily, Dec 23, 2003.

  1. Lily

    Lily Guest

    Hi there,
    I have 10 textboxs on a page. When tab into a textbox, the entire text
    ($0.00) in a textbox is selected in blue. How do I have this effect by
    single clicking on the textbox?
    Lily, Dec 23, 2003
    #1
    1. Advertising

  2. Lily

    Teemu Keiski Guest

    Hi,

    add this attribute to the TextBox:

    onclick="this.select()"

    For Example:
    <asp:TextBox id="TextBox1" onclick="this.select()" runat="server">

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    "Lily" <> wrote in message
    news:...
    > Hi there,
    > I have 10 textboxs on a page. When tab into a textbox, the entire text
    > ($0.00) in a textbox is selected in blue. How do I have this effect by
    > single clicking on the textbox?
    >
    >
    >
    Teemu Keiski, Dec 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. Slim
    Replies:
    6
    Views:
    388
    Eliyahu Goldin
    Jul 31, 2006
  2. =?Utf-8?B?QW5u?=
    Replies:
    0
    Views:
    435
    =?Utf-8?B?QW5u?=
    May 12, 2007
  3. Ann
    Replies:
    7
    Views:
    435
    Dominick Baier
    May 15, 2007
  4. Matthew Louden
    Replies:
    3
    Views:
    270
    Ray at
    Jan 9, 2004
  5. M Wells
    Replies:
    0
    Views:
    136
    M Wells
    Oct 6, 2004
Loading...

Share This Page