[whatwg] 'input' event interpretation

Michael A. Puls II shadow2531 at gmail.com
Fri May 2 08:31:36 PDT 2008


On 5/2/08, Rimvydas <naktinis at gmail.com> wrote:
> The question is related to the 'input' event on Web Forms 2.0.
>
>  The WF2 specification says:
>  "This [input] event must be fired on a control whenever the value of
>  the control changes due to input from the user, and is otherwise
>  identical to the change event."

It's supposed to fire with *any* user-initiated change you can think
of. But, there can be a lot of ways to change a value, so it might
take a while to support firing for every scenario.

By "change", that means to a *different* value. If you hit del in an
empty textarea for example, the event shouldn't fire.

If you want non-user-initiated changes by scripts etc., there's
DOMControlValueChanged. Opera supports that I think, but it may not
detect everything yet.

There are still bugs in Firefox, Safari and Opera with input right now.

I think you can only do oninput via addEventListener in Firefox (as
opposed to .oninput= ).

Opera fires the event twice for each change sometimes.

Safari's input event support is broken right now.

The spec should probably gives some examples of what's considered a
user-initiated change: drag, cut, paste (with mouse or keyboard) etc.

-- 
Michael



More information about the whatwg mailing list