Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

onkeydown before onchange event

 
Luke Zechariah
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic