robert.crowther (59) [Avatar] Offline
#1

The forminput event now looks likely to be removed from the HTML5 spec. The only browser to have implemented it so far is Opera, and it is possible to replicate the functionality through normal event bubbling if you use attachEvent for adding events rather than doing them inline in attributes.


Assuming you have a function updateOutput to update your output elements, then this event registration:


document.getElementById('myform').addEventListener('forminput', updateOutput, false);


Is functionally equivalent to this one as long as you don't capture and block any input events:


document.getElementById('myform').addEventListener('input', updateOutput, false);


Rob



Message was edited by:
robert.crowther

Changed second code example, last parameter is not significant.
robert.crowther (59) [Avatar] Offline
#2
Re: Section 3.4.5 - onforminput
Good news, looks like onforminput is staying, here's Hixie's comment on the bug report:<blockquote>Since you can't register capturing handlers declaratively, and since
form controls can be all over the place in the DOM now, I think 'forminput' and
'formchange' are still very helpful and have clear use cases. As as
straightforward demonstration of this, try to rewrite the examples in the spec
that use these features to do them without onforminput/onformchange and see
whether it's still as simple.</blockquote>
Rob
robert.crowther (59) [Avatar] Offline
#3
Re: Section 3.4.5 - onforminput
And once more things have changed - the onforminput event has now been dropped, so ignore that section of chapter 3 for now. I'll re-write the next time I'm updating that chapter.

Rob