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
achuter@teleservicios.com
Received on Friday, 4 July 2003 04:06:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 July 2011 18:14:10 GMT