This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes onkeydown before onchange event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "onkeydown before onchange event" Watch "onkeydown before onchange event" New topic
Author

onkeydown before onchange event

Luke Zechariah
Ranch Hand

Joined: Sep 27, 2005
Posts: 117
I have onkeydown event and a onchange event for a drop down list. The problem is that if a user has to type "jww", the moment they type "j" the onchange event is triggered. Is there way the onchange event can be delayed till the onkeydown event is completely finished.

Thank you for your reply in advance.
Luke
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Only choice you will have is use onblur or add a setTimeout to the onchange delay the firing and use cancelTimeout.

Eric
Luke Zechariah
Ranch Hand

Joined: Sep 27, 2005
Posts: 117
Eric, thanks that was a very quick reply. Here is my code, I am not good at javascript can you let me know what to add please:



Thank you,
Lk.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
look at this:
http://www.manning-sandbox.com/thread.jspa?threadID=14781&tstart=0

You may want to cancel the timeout with the onkeypress

Eric
 
Don't get me started about those stupid light bulbs.
 
subject: onkeydown before onchange event
 
Similar Threads
Replace keycode value in Firefox
Call a javascript function from a JSP
Hidden button is shown in FireFox
Need Event Timer
calling submit internally