I've got an input field and I'm using the onblur event handler to call a method that does some validation when the input field loses focus.
Thats fine but if the user closes the window then onblur is calling that method to do the validation, which I dont want, if they close the window I would like the window to close without onblur calling that method.
How could I do this ?
I assume you are trying to avoid showing an unnecessary alert box. Unless the warning is done in an unobtrusive way, validating with the blur event is not advisable.
Originally Posted by garyt
or you can write a adUnloadListener function, that removes the onblur even listener from the input before the page woul unload itself..