[Bug 11129] Remove forminput, formchange and related dispatch methods

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11129

--- Comment #15 from Simon Pieters <simonp@opera.com> 2011-01-26 21:41:21 UTC ---
(In reply to comment #14)
> Those are not really a use cases, but descriptions how one could
> use the events and methods ;)

Consider a shopping cart where the customer can select the quantity of each
item and the page updates the total amount on the fly. The author generates the
shopping cart with PHP but doesn't know enough about javascript and DOM Events
to be confident about how to walk the tree or use capturing event listeners (or
even that they exist), so instead outputs the calculation script in the
onforminput="" attribute with PHP since he already has implemented the logic to
output the actual shopping cart itself with PHP. The end result might be
something like:

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/804

> Also, why couldn't scripts use the existing events for the first case?

You need a capturing event listener for that, which is not available as markup
and many authors who know enough to use event handler attributes don't know
that capturing event listeners exist or how they work.

> And for the latter one there could be just a javascript function to call.

If you have several event handler content attributes you would need to call all
of them. It's more convenient to dispatch an event.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 26 January 2011 21:41:25 UTC