Paul THompson wrote:
[color=blue]
> I have been working for some time to 1) detect tab and shift tab
> events 2) control the focus on the basis of these events. I have
> found that I can do this, but continue to have nagging problems.
>
> One of the main problems at this point lies in cancelling the event.
> I have found that the TAB fires the onkeypress in NN, but not in IE.
> I can cancel the onkeypress fine in NN. The TAB fires the onkeydown
> in IE and can be cancelled in IE. This all works fine. I cancel
> events in both cases by
>
> return false;
>
> However, I have one problem. In NN, when focus is on a select object,
> onkeypress will not fire when TAB is pressed. Rather, only onkeydown
> fires.
>
> I cannot cancel onkeydown in NN. I would use onkeydown routinely, but
> have not determined how to cancel it in NN. In IE, it cancels fine.
>
> Can anyone tell me if there is some secret to cancelling onkeydown in
> NN? Is this one of those bubble-up deals?[/color]
As far as I remember Mozilla/Netscape key event architecture only allows
to cancel keypress events. It is how they implemented it (or were only
able to implement it) and in the absence of key events in DOM Level 2 it
is difficult to argue with them that any specs says different.
--
Martin Honnen
http://JavaScript.FAQTs.com/