Last Comment Bug 605997 - Implement forminput event
: Implement forminput event
Status: RESOLVED WONTFIX
: 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
:
:
Mentors:
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:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Alexander Farkas 2010-10-20 15:31:20 PDT
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.10) 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 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:
<form>
  <input name='a'>
  <input name='b'>
  <output onforminput="your_stuff();"></output>
</form>

You will have to do:
<form>
  <script>function updateOutput() { your_stuff(); }</script>
  <input name='a' oninput="updateOutput();">
  <input name='b' oninput="updateOutput();">
  <output></output>
</form>
Comment 2 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 Alexander Farkas 2010-10-22 03:36:29 PDT
@Mounir

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):

<form>
	<input name='a'>
	<input name='b'>
	<output></output>
	
</form>

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

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 @ http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ 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 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 Mounir Lamouri (:mounir) 2010-10-23 04:04:30 PDT
W3C bug:
http://www.w3.org/Bugs/Public/show_bug.cgi?id=11129
Comment 6 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 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 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.