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


Groups > comp.lang.javascript > #12636

Re: The onkey*= Clause et al: Solved

From Gene Wirchenko <genew@ocis.net>
Newsgroups comp.lang.javascript
Subject Re: The onkey*= Clause et al: Solved
Date 2012-03-12 22:13 -0700
Organization A noiseless patient Spider
Message-ID <filtl79tp84qv21uuulhk7d7arl5rieoko@4ax.com> (permalink)
References <72m2l7lf5kn3d4v63ufslu4p6v235bpkbp@4ax.com> <ce463500-cb2c-4c02-ac93-7ff32b5adf9c@j11g2000yqj.googlegroups.com> <65i8l716c9mu25gr7j4hh95fkggs4tsrr8@4ax.com> <bffabdeb-c0b0-4a23-a0ff-334493e052bc@r34g2000yqn.googlegroups.com>

Show all headers | View raw


On Mon, 12 Mar 2012 21:51:42 -0700 (PDT), David Mark
<dmark.cinsoft@gmail.com> wrote:

>On Mar 5, 1:02 am, Gene Wirchenko <ge...@ocis.net> wrote:
>> On Fri, 2 Mar 2012 20:05:01 -0800 (PST), David Mark
>>
>> <dmark.cins...@gmail.com> wrote:
>> >On Mar 2, 6:37 pm, Gene Wirchenko <ge...@ocis.net> wrote:
>> >> Dear JavaScripters:
>>
>> >>      I finally got my form reset with <Esc> working.  The event model
>> >> of JavaScript controls is definitely not as clear as I would like.
>>
>> >See my reply in previous thread. Your problem was related to a bad
>> >assumption, not the DOM event model.
>>
>>      Well, given that the event model is not clear, that pretty much
>> set me up to make wrong assumptions.  You tell me why if a control has
>> focus, that its onblur would fire as soon as I re-enabled validations.

>Re-enabled validations?  ISTM that there were several problems with
>the code, but I don't follow what you are talking about with respect
>to "validations".

     I have onblur event code that validates for each control.  If the
validation fails, focus has to be put back to the erroneous control.
In order to do this, the validation for the new control must be turned
off before the focus is moved.  If it is not, then it may result in
another validation failure.  After, the validation must be turned back
on.

     I turn the validation on and off by setting a global
appropriately.  The start of the validation code checks whether
validation is currently enabled and simply returns true if validation
is off.

     The problem was the <Esc> handling that I was having was that as
soon as I turned the validation back on, the validation code was
executed.  Somehow, an event was firing.

     This problem has been dealt with, but it was not easy to track
down.

Sincerely,

Gene Wirchenko

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


Thread

The onkey*= Clause et al: Solved Gene Wirchenko <genew@ocis.net> - 2012-03-02 15:37 -0800
  Re: The onkey*= Clause et al: Solved David Mark <dmark.cinsoft@gmail.com> - 2012-03-02 20:05 -0800
    Re: The onkey*= Clause et al: Solved Gene Wirchenko <genew@ocis.net> - 2012-03-04 21:02 -0800
      Re: The onkey*= Clause et al: Solved David Mark <dmark.cinsoft@gmail.com> - 2012-03-12 21:51 -0700
        Re: The onkey*= Clause et al: Solved Gene Wirchenko <genew@ocis.net> - 2012-03-12 22:13 -0700
          Re: The onkey*= Clause et al: Solved David Mark <dmark.cinsoft@gmail.com> - 2012-03-12 22:38 -0700
            Re: The onkey*= Clause et al: Solved Gene Wirchenko <genew@ocis.net> - 2012-03-13 19:40 -0700
              Re: The onkey*= Clause et al: Solved David Mark <dmark.cinsoft@gmail.com> - 2012-03-13 20:56 -0700
  Re: The onkey*= Clause et al: Solved Dr J R Stockton <reply1209@merlyn.demon.co.uk> - 2012-03-03 20:35 +0000

csiph-web