Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18936

'onblur' problem

From "Mel Smith" <med_cutout_syntel@aol.com>
Newsgroups comp.lang.javascript
Subject 'onblur' problem
Date 2013-03-18 12:55 -0700
Message-ID <aqp9q0FijugU1@mid.individual.net> (permalink)

Show all headers | View raw


HI:

    I have a <select> tag on a page that is on focus as soon as the user 
opens the page with his browser, and also that has the following 'onblur' 
property:

    <select etc, etc.,   onblur="chkentrymethod();" >
    ...several options here ...
    </select>

Normal Operation:
     If the user fails to 'select' one of the several options in the 
<select> tag, and instead focuses on another field,  I immediately 'alert' 
the user and re-focus back on the <select> element. I do this until he 
'selects' one of the options. Works good !

Problem Operation (at least for IE8) :
    If the user clicks the 'X' (eXit the browser) button in the top-right 
corner *before* selecting an option, my IE8 browser senses the 'onblur' 
event and shows the alert message -- even though by that time the browser 
has already shutdown.  Very messy of me to allow this.

Question:
    How can I sense that the user is simply closing down the browser, and 
stop the onblur event from presenting the alert() message.

Thank you.
-- 
Mel Smith

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

'onblur' problem "Mel Smith" <med_cutout_syntel@aol.com> - 2013-03-18 12:55 -0700
  Re: 'onblur' problem Stefan Weiss <krewecherl@gmail.com> - 2013-03-18 21:14 +0100
    Re: 'onblur' problem "Mel Smith" <med_cutout_syntel@aol.com> - 2013-03-18 17:45 -0700

csiph-web