Last Comment Bug 605997 - Implement forminput event
: Implement forminput event
: html5
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
-- enhancement (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Andrew Overholt [:overholt]
Depends on:
Blocks: html5forms
  Show dependency treegraph
Reported: 2010-10-20 15:31 PDT by Alexander Farkas
Modified: 2013-01-12 07:04 PST (History)
9 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Alexander Farkas 2010-10-20 15:31:20 PDT
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv: Gecko/20100914 Firefox/3.6.10
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv: Gecko/20100914 Firefox/3.6.10

You have recently implemented the output element (#346485). But it seems, that you didn't add the forminput-event. I haven't seen an issue for implementing this event @ #344614. Due to the fact, that the output element is quit unsuable without forminvalid-event, it would be good to add.

Reproducible: Always
Comment 1 User image Mounir Lamouri (:mounir) 2010-10-20 16:14:33 PDT
I understand forminput event might be very helpful but I think <output> is still usable without it. It's just a bit more annoying.

Instead of:
  <input name='a'>
  <input name='b'>
  <output onforminput="your_stuff();"></output>

You will have to do:
  <script>function updateOutput() { your_stuff(); }</script>
  <input name='a' oninput="updateOutput();">
  <input name='b' oninput="updateOutput();">
Comment 2 User image Mounir Lamouri (:mounir) 2010-10-21 04:09:22 PDT
This said, I understand that life would be easier with onforminput but with the feature freeze, it might be hard to add that for Firefox 4/Gecko 2.0.
Comment 3 User image Alexander Farkas 2010-10-22 03:36:29 PDT

No problem. I already said, that I like the current implementation of HTML5 form features in FF4 (It has less features, than others, but is a lot more consistent and compiliant).

BTW: You can make the input event behave similiar to the forminput, by setting the useCapture argument in addEventListener to true and adding it on an ancestor of the input elements (i.e.: form):

	<input name='a'>
	<input name='b'>

	function updateOutput() { your_stuff(); }
	document.getElementsByTagName("form")[0].addEventListener("input", updateOutput, true);

My only problem is, how can I feature detect, wether a browser has implemented this feature. I thought, every browser, wich has implemented output will also implement forminput, but this assumption isn't true anymore. The script @ doesn't work with input event in firefox 3.0-4.0 and I don't think would work with forminput in an upcomming release of FF 4.5/5.0. Have you any ideas?
Comment 4 User image Erik Arvidsson 2010-10-22 11:07:41 PDT
There is currently a discussion about removing forminput and formchange from the spec since they are such an edge case that can easily be solved with capturing event listeners.
Comment 5 User image Mounir Lamouri (:mounir) 2010-10-23 04:04:30 PDT
W3C bug:
Comment 6 User image Mounir Lamouri (:mounir) 2011-01-03 01:39:07 PST
For information, the W3C bug has been marked WONTFIX. We might add onform* events for the next Firefox release (after Firefox 4).
Comment 7 User image Mounir Lamouri (:mounir) 2011-03-03 16:54:46 PST
Finally, the bug has been resolved on the w3c side. This one is going to be marked WONTFIX then.
Comment 8 User image Eric Shepherd [:sheppy] 2011-03-15 11:47:32 PDT
Will not require docs since spec has wontfixed this.

Note You need to log in before you can comment on or make changes to this bug.