W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > July to September 2003

onKeyPress activates link in Opera

From: Alan Chuter <achuter@teleservicios.com>
Date: Fri, 4 Jul 2003 10:08:43 +0200
Message-ID: <001e01c34203$825799a0$0bb8c90a@NTWKS72>
To: <w3c-wai-ig@w3.org>

I have created two links and a JavaScript function. To ensure keyboard
accessibility, I understand that I should use both onClick and onKeyPress.
These would normally be used to open a popup window, not an alert box.

<a href="popup.html" onclick="popup('popup.html')">onclick</a>
<a href="popup.html" onkeypress="popup('popup.html')">onkeypress</a>

function popup(url){
  window.open(url, ...);

In Opera, the onClick event handler is fired by pressing Enter (which
doesn't make sense, I think). But the onKeyPress activates the link when I
navigate off it by pressing the A key. The first behaviour suggests that
onKeyPress is unnecessary. The second, that using onKeyPress actually makes
the page unusable. Internet Explorer seems to ignore the tab key press when
tabbing through the links.

Am I missing something here? Can I tell people to use onKeyPress as a
redundant even handler, knowing that it misbehaves in Opera?

Alan Chuter.
Accessibility Consultant.
Fundosa Teleservicios, SA
Fundación ONCE.
Tel:+34 91 121 03 35
Received on Friday, 4 July 2003 04:06:07 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 13 October 2015 16:21:24 UTC