Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] When should an "onChange" event actually change?



> It's as if "onChange" is behaving like what you might call a "mouse 
> out", or an "onChangeOfFocus". I thought "onChange" mean whenever you 
> changed the content of the text field.

I think you need to be looking at key presses instead. E.g.
  http://joshualay.net/blog/2010/02/visual-feedback-with-jquery/
(But note: he has a typo in handling the 2nd condition.)

Also, change() is different between browsers. E.g. for checkboxes
firefox/safari will send a change event when it is clicked, but IE won't
until the checkbox has lost focus. (So, in that case, use the "click"
event instead.) (*)

Darren

*: E.g. see p.118 of JQuery in Action.


-- 
Darren Cook, Software Researcher/Developer

http://dcook.org/gobet/  (Shodan Go Bet - who will win?)
http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links