Textbox Focus Event

Discussion in 'ASP .Net Web Controls' started by Derek, Jun 17, 2005.

  1. Derek

    Derek Guest

    I am working on an ASP.NET page where I need to perform a procedure when the
    user enters data in a textbox. Ideally, I would like to be able to run the
    procedure when the user moves the cursor focus AWAY from the textbox.
    However, I am not sure how to do this. Any suggestions would be greatly
    appreciated. Thanks.
    Derek, Jun 17, 2005
    #1
    1. Advertising

  2. Derek

    Guest

    The opposite of onfocus is onblur. In ASP.NET, there's a TextChanged
    event on TextBoxes, but that only fires if the text was actually
    changed. If it wasn't, moving focus off of the box won't trigger the
    event.

    You could make a custom textbox that has an onblur event, using the
    standard javascript onblur event. Or just use the javascript one
    directly, and have it change the contents of an invisible textbox and
    grab the TextChanged event of the hidden one.

    All sorts of ways, I guess.

    Lisa



    Derek wrote:
    > I am working on an ASP.NET page where I need to perform a procedure when the
    > user enters data in a textbox. Ideally, I would like to be able to run the
    > procedure when the user moves the cursor focus AWAY from the textbox.
    > However, I am not sure how to do this. Any suggestions would be greatly
    > appreciated. Thanks.
    , Jun 17, 2005
    #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. Gill Smith
    Replies:
    1
    Views:
    650
    Teemu Keiski
    May 21, 2004
  2. JC
    Replies:
    4
    Views:
    7,947
    Jeff C
    Jul 8, 2004
  3. Jason
    Replies:
    4
    Views:
    1,589
    Jason
    May 7, 2007
  4. Replies:
    2
    Views:
    325
    Thomas 'PointedEars' Lahn
    Jun 6, 2005
  5. Roger
    Replies:
    3
    Views:
    304
Loading...

Share This Page