Textbox Focus Event

D

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.
 
L

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,263
Messages
2,571,064
Members
48,769
Latest member
Clifft

Latest Threads

Top