W3C home > Mailing lists > Public > w3c-wai-gl@w3.org > April to June 2002

RE: onclick and onkeypress scripting technique issue

From: Cynthia Shelly <cyns@microsoft.com>
Date: Wed, 17 Apr 2002 09:38:54 -0700
Message-ID: <7164D4266FD7B94CA59D551C7FE6618D03D449E0@red-msg-08.redmond.corp.microsoft.com>
To: "Charles McCathieNevile" <charles@w3.org>, "Phill Jenkins" <pjenkins@us.ibm.com>
Cc: <w3c-wai-gl@w3.org>
IE has such an action, at least for click.  I haven't tried mouseover,
but MSDN (http://msdn.microsoft.com) should have documentation on which
events can be fired this way.  If memory serves, this worked all the way
back to IE4.

<span tabindex="1" onclick="alert('click');"
onkeypress="this.click();">hot span</span>

Paste this into an HTML page, tab till the "hot span" has focus, and hit
a key.  You'll see the 'click' alert.

-----Original Message-----
From: Charles McCathieNevile [mailto:charles@w3.org] 
Sent: Wednesday, April 17, 2002 9:13 AM
To: Phill Jenkins
Cc: w3c-wai-gl@w3.org
Subject: Re: onclick and onkeypress scripting technique issue

Hi Phill,

yes, there is a new issue to deal with here, at the same time as dealing
with a legacy issue - IE has linked some events, but not all of them,
other developers have implemented the spec as is, and the result is that
it is hard for authors.

My initial thoughts are that it would be useful if IE had a deliberate
"fire the mouse" action that could be keyboard generated, or if the
specifications were written to unify the mouse and keyboard models, but
having an unspecified half-way solution is not serving us in the long
term. On the other hand, it should be acknowledged that they have helped
some people in the short term.

I recommend that people interested in this question consider the PF
working group as a venue for further discussion - there are several
groups working on event models including HTML, and SVG. I realise the
member-only nature of that group means people will have to join it and
agree to the confidentiality requirements, but consider that the work
there is valuable.


Charles McCN

On Wed, 17 Apr 2002, Phill Jenkins wrote:

  >To: HTML techniques editors
  >In the WCAG HTML techniques [1] about making scripts directly
  >it says to <quote> provide redundant input mechanisms. In other
  >specify two handlers for the same element such as "onclick" with
  >"onkeypress" <endquote>.  This practice seems to be causing problems
  >because the IE 5.5 browser (for example) sends two events to the
  >when using the keyboard, but only one event when using the mouse.  IE
  >the keyboard to some mouse events, such as allowing the user to tab
to the
  >form controls and pressing the enter key instead of using the mouse
  >trigger the event, so the second onkeypress event is not necessary.
  >1. Is it IE that has a bug?  What about Netscape, Opera, Lynx, etc
  >2. What about the assumption of the User Agents capability and other
  >software standards?
  >508 and UAAG all require the ability to do with the keyboard what can
  >done with the mouse.  IE and other browsers should allow the user to
  >the controls with only the keyboard.  Techniques and standards should
  >require or put burden on the content author that causes problems,
  >especially when the burden should and is being handled by the user
  >Why add on keypress when the device or agent is capable of the
  >So, what is a web developer to do?  Following the techniques causes
  >The technique seems to have been established in Feb 1999, or at least
  >is when the issue [2] was raised and resolved.  But, in my opinion,
  >resolved incorrectly with today's browser capabilities and today's
  >standard [3].  In other words, a new issue should be logged.
  >[1] Directly Accessible Scripts
  >[2] Device independent
  >[3] UAAG requirement
Received on Wednesday, 17 April 2002 12:39:26 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 16 January 2018 15:33:41 UTC