Home All Groups Group Topic Archive Search About
Author
17 Jun 2005 8:36 PM
Derek
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.

Author
17 Jun 2005 8:49 PM
lisa
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:
Show quoteHide quote
> 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.