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


Groups > comp.lang.javascript > #9772

Alert and Input Control Events

From Gene Wirchenko <genew@ocis.net>
Newsgroups comp.lang.javascript
Subject Alert and Input Control Events
Date 2011-12-29 15:28 -0800
Organization A noiseless patient Spider
Message-ID <tftpf71vp0a6shta2387ren56i64tqvs3i@4ax.com> (permalink)

Show all headers | View raw


Dear JavaScripters:

     Does using alert() cause input control events to fire?

     I am writing some validation routines where I want the control to
keep the focus if the test fails.  (Yes, I know that this is
desktop-app style.  That is what I want.)

     Actually, if onblur fires, the focus has already moved.  To get
around this, I have a global that is set if validation is already
occurring on another input control.  In that case, I simply bypass the
validation on the second control so that the focus can be set back.

     This works (IE 9 & Windows 7).

     It seems that the order of statements is important.  I have to
set the focus back before generating the error alert.  Otherwise, it
does not work right, and I can get the other input control's
validation routine getting in the way.  I also had the hilarity of my
debugging alert() statements affecting the program flow.

     It seems to me that alert() might cause input control events to
fire.  Is this so?  If so, is it guaranteed to be like this, or is it
just IE 9's implementation?  How tied to implementation is this error
handling making my code?

Sincerely,

Gene Wirchenko

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


Thread

Alert and Input Control Events Gene Wirchenko <genew@ocis.net> - 2011-12-29 15:28 -0800
  Re: Alert and Input Control Events Stefan Weiss <krewecherl@gmail.com> - 2011-12-31 01:27 +0100
    Re: Alert and Input Control Events Gene Wirchenko <genew@ocis.net> - 2011-12-31 23:40 -0800
      Re: Alert and Input Control Events Gregor Kofler <usenet@gregorkofler.com> - 2012-01-01 12:02 +0100
        Re: Alert and Input Control Events "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-01-01 13:21 +0000
          Re: Alert and Input Control Events Gregor Kofler <usenet@gregorkofler.com> - 2012-01-01 16:55 +0100
        Re: Alert and Input Control Events Gene Wirchenko <genew@ocis.net> - 2012-01-02 10:49 -0800
          Re: Alert and Input Control Events Scott Sauyet <scott.sauyet@gmail.com> - 2012-01-03 04:54 -0800
            Re: Alert and Input Control Events Gene Wirchenko <genew@ocis.net> - 2012-01-03 17:13 -0800

csiph-web