These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:06 pm Advanced search

the change event

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

the change event

Postby naktinis » Tue Apr 15, 2008 7:28 am

According to html 4.01 spec. input element's 'change' event is fired when "a control loses the input focus and its value has been modified since gaining focus." This could be helpful if user changes the value and switches focus thus indicating that the text-entering is done. However, the feature I wanted to propose or discuss would be an event which is fired when the input field actually changes, i.e. you don't have to blur the field. The proposed event would react to key presses, selecting from autocomplete lists etc. This would be helpful because:

  • there are currently many ajax pages that could react to any change and represent some data in real time when value changes
  • there is no way for browser to say that it has used its automatic form filling tools (when using opera wand, it even fills two input fields without informing the DOM; similar in firefox), because the focus hasn't changed and they don't want to violate html recommendations
naktinis
<h6>
 
Posts: 2
Joined: Tue Apr 15, 2008 7:04 am

Postby anne » Tue Apr 15, 2008 9:42 pm

Web Forms 2.0 introduced the 'input' event which does exactly that. It's also implemented in Opera and Firefox (at least).
User avatar
anne
<h4>
 
Posts: 32
Joined: Tue Feb 06, 2007 11:17 pm
Location: Utrecht, NL

Postby naktinis » Wed Apr 16, 2008 7:27 pm

Yes, 'input' event does solve a small part of the problem. However, I just check on opera and firefox3 - they fire the event when I enter something, but if i select an entry from autocomplete list or browser fills some forms for me - it is not fired.

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.


Here I can see the "input from the user". It makes me wonder why browsers interpreted it the way that selecting from an autocomplete list is not an input from the user...

Correct me if I'm wrong, but this action doesn't solve the automatic form filling question. The values of input fields change when browser fills them, so why shouldn't DOM be aware of that and take necessary actions?

So two questions arise:
1) How much is it practically different from 'keypressed' event?
2) What about autocomplete list and auto filling - which is not "input from the user", but field values actually do change.
naktinis
<h6>
 
Posts: 2
Joined: Tue Apr 15, 2008 7:04 am


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest