[thelist] Q on events

Burhan Khalid thelist at meidomus.com
Tue Oct 7 00:55:34 CDT 2003


jsWalter wrote:
> I have these event handlers defined...
> 
>    objFormEle.onkeypress = setBar;
>    objFormEle.onkeydown  = setBar;
>    objFormEle.onkeyup    = setBar;
> 
> Whenever that event happens in that Form Element, that method is fired.
> 
> All well and good, but anyone have any idea why BACKSPACE does not fire off
> any of these events?

I think by default IE doesn't trigger backspace key as an event because 
its also a shortcut to the "Back" button. You can get around that 
problem easily by simply putting a check in your functions, something like :

var key = window.event.keyCode

if (key == 8) { alert('aha! backspace!'); }

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

-- 
Burhan Khalid
thelist[at]meidomus[dot]com
http://www.meidomus.com



More information about the thelist mailing list