By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,051 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

select onchange with typing in Webkit

P: n/a
In Firefox, IE and Opera, with a select menu with size 1, typing a few
characters in the menu selects an item and triggers the onchange event.

In the Webkit-based Safari and Google Chrome, the item appears to be
selected (visually and selectedIndex is set) but the onchange is not
triggered.

The W3C says "The onchange event occurs when a control loses the input
focus and its value has been modified since gaining focus."

http://www.w3.org/TR/REC-html40/interact/scripts.html

Doesn't that mean if you type to select then tab or click away from the
menu, the onchange should fire? This doesn't happen in Safari or Google
Chrome.

I can work around this with an onblur but is it me or Webkit not getting
this right?

Toy example at

http://www.cs.northwestern.edu/~ries.../menutest.html
Oct 7 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Chris Riesbeck wrote:
The W3C says "The onchange event occurs when a control loses the input
focus and its value has been modified since gaining focus."

http://www.w3.org/TR/REC-html40/interact/scripts.html

Doesn't that mean if you type to select then tab or click away from the
menu, the onchange should fire?
It does mean that.
This doesn't happen in Safari or Google Chrome.
It does happen in "Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE)
AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21".
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Oct 7 '08 #2

P: n/a
On Oct 9, 1:35*am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
(...)
That is indeed a bug as is Safari's not regarding the selection a change in
the control's value when it is caused by putting in the leading characters;
however, Quirks Mode might trigger this non-standard behavior. *(I cannot
test it right now.)
I did. I does fail in Safari 3.1.2, latest released version.
But it's been fixed already in the nightly builds (I tested r36882):

http://nightly.webkit.org/

--
Jorge.
Oct 9 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.