PROGRAMMING DOMINO FOR WEB APPLICATIONS


JavaScript events
Example

The following Domino objects have JavaScript event handlers: form, subform, page, field, action, button, and action hotspot. You can attach code to these event handlers in the Programmer's pane. The code executes when the event occurs in a browser that supports the event, and, limitedly, in the Notes client.

Table of JavaScript events

The following table lists the JavaScript event handlers in Lotus Domino Designer. "Browser only" means that the event handler only works in browsers that support it. "Browser and Notes" means that the event handler works in browsers that support it and the Notes client.

EventForm, subform, pageFieldAction, button, hotspot
JSHeaderBrowser and NotesUses the JSHeader for the form, subform, or page
onBlurNABrowser and NotesBrowser only
onChangeNABrowser and NotesNA
onClickBrowser onlyBrowser onlyBrowser and Notes
onDblClickBrowser onlyBrowser onlyBrowser only
onFocusNABrowser and NotesBrowser only
onHelpBrowser and NotesNABrowser only
onKeyDownBrowser onlyBrowser onlyBrowser only
onKeyPressBrowser onlyBrowser onlyBrowser only
onKeyUpBrowser onlyBrowser onlyBrowser only
onLoadBrowser and NotesNANA
onMouseDownBrowser onlyBrowser onlyBrowser only
onMouseMoveBrowser onlyBrowser onlyBrowser only
onMouseOutBrowser onlyBrowser onlyBrowser only
onMouseOverBrowser onlyBrowser onlyBrowser only
onMouseUpBrowser onlyBrowser onlyBrowser only
onResetBrowser only, form onlyNANA
onSelectNABrowser onlyNA
onSubmitBrowser and NotesNANA
onUnloadBrowser and NotesNANA

Events that work in browsers and the Notes client

Restrict code that must work in both a browser and the Notes client to the following events:


JSHeader event

JSHeader is a special event handler that loads code such as functions and global variable declarations that all the events in the object can access. This code goes under the <HEAD> tag in Domino-generated HTML.

onSubmit event

The onSubmit event occurs in a browser and the Notes client when the FileSave @command executes. In a browser, you can return false from the onSubmit event to abort the save operation.

Enabling JavaScript in the Notes client

To run JavaScript in a Notes client, the user must select "Enable JavaScript" under "Additional Options" after choosing File - Preferences - User Preferences. To expand or limit security, the user must select "Using JavaScript" under "What Others Do" after choosing File - Security - User Security.

Example
See Also