onKeyPress

Arguments

eventKeyboardEvent Object

An object that contains information about the keyboard event, such as the key that was pressed. The properties available to you in this object are defined and set by the client's browser.

Description

Specify the Javascript for this event. The onKeyPress event fires when the user presses a key that produces a character value and the element has focus.

Discussion

The onKeyPress event fires when the user presses a key on the keyboard that produces a character value, such as a letter, number, or punctuation. Keys that do not produce a character, such as shift or alt, will not trigger the onKeyPress event.

The event fires after the onKeyDown event. You can add Action Javascript, custom JavaScript, or sever-side Xbasic to execute one or more actions to this event.

For more information about keyboard events, see Mozilla's documentation on KeyboardEvents or the developer documentation for your favorite web browser.

See Also