[thelist] Q on events

Jeff Howden jeff at jeffhowden.com
Tue Oct 7 01:39:16 CDT 2003


burhan,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Burhan Khalid
>
> I think by default IE doesn't trigger backspace key as
> an event [...] get around that problem easily by simply
> putting a check in your functions, something like :
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

if it doesn't trigger the event, then how is the function going to trap it?
fortunately that's not the case.  checking my references i'm not seeing
where this should be an issue.  as of ie5, the backspace key fires the
onkeydown [1] and onkeyup [2] events.  so, as you noted, it's simply a
matter of checking for the proper keyCode and exiting the function (or
whatever the desired behavior is).

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> If this problem is also in non-IE browsers, then just
> ignore me :P
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

mozilla and opera both translate a press of the backspace key as a click of
the "back" button, but only when the cursor is not in a text|hidden|password
input or textarea.

.jeff

------------------------------------------------------
Jeff Howden - Web Application Specialist
Resume - http://jeffhowden.com/about/resume/
Code Library - http://evolt.jeffhowden.com/jeff/code/

[1]
http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onkeydown.a
sp
[2]
http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onkeyup.asp



More information about the thelist mailing list