Form Test D of N:
onfocus Event Handler Attached to SELECT

What Is Being Tested?

User agents often perform a task when an event occurs that is due to user interaction (e.g., document loading, mouse motion or a key press), a request from the operating environment, etc. Some markup languages allow authors to specify that a script, called an event handler, be executed when the event occurs. An event handler is "explicitly associated with an element" when the event handler is associated with that element through markup or the DOM. The term "event bubbling" describes a programming style where a single event handler dispatches events to more than one element. In this case, the event handlers are not explicitly associated with the elements receiving the events (except for the single element that dispatches the events).

This document is part of a suite of pages designed to test the implementation of the W3C's User Agent Accessibility Guidelines (UAAG). In particular, this page is designed to test implementation of UAAG checkpoints 5.4, 9.4, and 9.5:

5.4 Allow configuration to prompt the user to confirm (or cancel) any form submission that is not caused by an explicit user request to activate a form submit control. [Priority 2] Content only.
Note: For example, do not submit a form automatically when a menu option is selected, when all fields of a form have been filled out, or when a "mouseover" or "change" event event occurs. The user agent may satisfy this checkpoint by prompting the user to confirm all form submissions.
Techniques for checkpoint 5.4

9.4 For the element with content focus, make available the list of input device event handlers explicitly associated with the element. [Priority 2] Content only.
Note: For example, allow the user to query the element with content focus for the list of input device event handlers, or add them directly to the serial navigation order. See checkpoint 1.2 for information about activation of event handlers associated with the element with focus.
Techniques for checkpoint 9.4

9.5 Allow configuration so that moving the content focus to an enabled element does not automatically activate any explicitly associated input device event handlers. [Priority 2] Content only.
Note: In this configuration, user agents should still apply any stylistic changes (e.g., highlighting) that may occur when there is a change in content focus.
Techniques for checkpoint 9.5

An onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation. In HTML4, the onfocus attribute may be used with the following elements: A, AREA, LABEL, INPUT, SELECT (the subject of this test page), TEXTAREA, and BUTTON

On this test page, the HTML4 event handler onfocus has been associated with a select option (list box) in a simple, one-field form that lacks an explicit Submit mechanism.

What Should Happen?

This page contains a simple, one-field form. If your user agent supports the ACCESSKEY mechanism introduced in HTML4, you can instantly establish focus on the list box using the ACCESSKEY defined for the form, f.

If your user agent supports scripting, and if support for scripting is active, once the select option list box receives focus your user agent will automatically fetch the User Agent Accessibility Guidelines.

If you are using a user agent that does not support scripting, or if you have support for scripting turned off, establishing focus by tabbing to the SELECT OPTION field or by clicking on the list box with a pointer, for example, should have no effect. Note that, since the form lacks an explicit Submit mechanism, it is therefore intrinsically dependent on scripting, you may not be able to use it to fetch the selected Guidelines document.

In order to conform to checkpoint 9.5, your user agent must offer a configuration in which you are able to establish focus on any element for which an input device event handler has been explicitly associated without automatically triggering that event. As regards this test page, this would mean that you are able to establish focus on the form control for which an onfocus event has been defined without triggering that event--in this case, fetching the document source for the User Agent Accessibility Guidelines upon the receipt of focus.

In order to conform to checkpoint 9.4, your user agent must allow you to query the form control, once it receives focus, for a complete list of the input device event handlers which have been explicitly associated with it.

In order to conform to checkpoint 5.4, your user agent must offer a configuration that prompts you to confirm the submission of any form if submission of the form's content is initiated by anything other than an explicit user request. Conformance with this checkpoint would prevent the automatic submission of the form upon receipt of focus even if your user agent did not satisfy checkpoints 9.4 and 9.5.

How to Provide Feedback

Please send comments and observations about this test page to <>. Your comments will be archived in the User Agent mailing list's public hypertext archive. Please make your observations as specific and detailed as possible. Be sure to include the following information when you report your observations to the User Agent Accessibility Guidelines Working Group:

  1. operating system (including version/revision number)
  2. assistive technology, if any (please include version number)
  3. user agent name and version (e.g. MSIE, version 5.00.2920.0000 update versions ;q254902)
  4. any special settings (i.e. any changes you or your adaptive equipment made to your user agent's default configuration)
  5. a description of what happened when the list box received focus; in particular:
    1. were you able to establish focus on the form without having it automatically fetch the Guidelines document?
    2. were you able to use the SUBMIT button (which should contain the text label "Get Guidelines") to obtain the Guidelines if you were able to establish focus on the form without having it automatically fetch the Guidelines document? Please be as specific as possible, listing all actions taken, such as keystroke sequences, use of a pointing device, etc.
    3. any error or warning messages you received

onfocus Form Test 1

Terminal Index
1) Return to the User Agent Test Suite's Index
2) User Agent Accessibility Guidelines Working Group (UAWG)
3) send comments and observations to

W3C Validated XHTML 1.0!     W3C Validated CSS!

last updated by Gregory J. Rosmaita 2:45 AM 5/19/2001

Copyright ©  2001 W3C (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.