W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2011

Re: Event for form element changes (onvaluechanged)

From: Aryeh Gregor <Simetrical+w3c@gmail.com>
Date: Fri, 8 Apr 2011 15:05:05 -0400
Message-ID: <BANLkTi=AkZhypsCe25HQJZW4RtaJZM9CAw@mail.gmail.com>
To: Glenn Maynard <glenn@zewt.org>
Cc: www-dom@w3.org
On Thu, Apr 7, 2011 at 9:46 PM, Glenn Maynard <glenn@zewt.org> wrote:
> The onchange event is only fired when an element loses focus.  This
> optimization may have made sense when Javascript engines were so slow that
> running scripts on each input was a bad idea, but it's a hassle now.

I don't think it's an optimization.  (We always had keypress, right?)
It's for cases where you actually want to only do something when the
input loses focus.  It's great for form validation, for example -- you
don't want to complain that the value is wrong before they've finished
typing it, nor if they were only tabbing through so it blurs but they
didn't change the value.
Received on Friday, 8 April 2011 19:05:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:07 GMT