Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can textboxes have onUnFocus events? 1

Status
Not open for further replies.

qwert231

Programmer
Sep 4, 2001
756
0
0
US
I want a VB.Net event to fire when the cursor moves out of the text box. Can I do this? If so, how?
 
qwert: best guess is to use a "on blur" type Java event; adding this property to the desired textbox. Do a quick search here at tek-tips - nearly all of the java routines such as these have been discussed and there should be many examples to be found (you might also drop by tek-tips Java forum and get their opinion re: lost focus java events.
 
Thanks, forgot about that one. onBlur, makes total sense, doesn't it.
 
Just keep in mind that the onblur event will fire if focus is set on the textbox and you try to close the window, not only when you tab out of the control.
 
Good point LV. Have you seen any solutions to getting around the closed event?
 
I am not a JS person, but if you call a function on the onblur event, then you can test for document close. I don't know if this is correct, but it seems to be logical.
 
Isadore: no, I haven't seen any workarounds. Depending on what you're trying to execute, I guess. I.e., if you try to validate an empty field and pop up an alert on blur, then it may become a mess - the alert will pop up every time you have a focus on the control but then deside to either close the window or move to another URL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top