Behaviors > About events

 

About events

The following list describes the events that you can associate with the actions listed in the Behaviors panel's Actions (+) pop-up menu. When a visitor to your Web page interacts with the page—for example, by clicking an image—the browser generates events; those events can be used to call JavaScript functions that cause an action to occur. (Events can also be generated without user interaction, such as when you set a page to automatically reload every 10 seconds.) Dreamweaver supplies many common actions that you can trigger using these events.

The list also specifies which browsers can generate each event. NS3 means Netscape Navigator 3.0; NS4 means Netscape Navigator 4.0; IE3 means Internet Explorer 3.0; IE4 means Internet Explorer 4.0. For more information about events in Microsoft Internet Explorer, see Microsoft's Dynamic HTML events page .

Note that most events can be used only with certain page elements. To find out what events a given browser supports for a given page element, insert the page element in your document and attach a behavior to it, then look at the Events pop-up menu in the Behaviors panel. For a very detailed advanced look at precisely which tags can be used with a given event in a given browser, search for the event in one of the files in your Dreamweaver/Configuration/Behaviors/Events folder.

onAbort (NS3, NS4, IE4, IE5) is generated when the visitor stops the browser from completely loading an image (for example, when the visitor clicks the browser's Stop button while an image is loading).

onAfterUpdate (IE4, IE5) is generated when a bound data element on the page has finished updating the data source.

onBeforeUpdate (IE4, IE5) is generated when a bound data element on the page has been changed and is about to lose focus (and is therefore about to update the data source).

onBlur (NS3, NS4, IE3, IE4, IE5) is the opposite of onFocus. The onBlur event is generated when the specified element is no longer the focus of the visitor's interaction. For example, when a visitor clicks outside a text field after clicking in the text field, the browser generates an onBlur event for the text field.

onBounce (IE4, IE5) is generated when a marquee element's contents have reached the boundary of the marquee.

onChange (NS3, NS4, IE3, IE4, IE5) is generated when the visitor changes a value on the page, such as when the visitor chooses an item from a menu, or when the visitor changes the value of a text field and then clicks elsewhere on the page.

onClick (NS3, NS4, IE3, IE4, IE5) is generated when the visitor clicks the specified element, such as a link, button, or image map. (The click is not complete until the visitor releases the mouse button; use onMouseDown to make something happen as soon as the button is pressed down.)

onDblClick (NS4, IE4, IE5) is generated when the visitor double-clicks the specified element. (Double-clicking is defined as quickly pressing and releasing the mouse button while pointing to the element.)

onError (NS3, NS4, IE4, IE5) is generated when a browser error occurs while a page or image is loading.

onFinish (IE4, IE5) is generated when the contents of a marquee element have completed a loop.

onFocus (NS3, NS4, IE3, IE4, IE5) is generated when the specified element becomes the focus of the visitor's interaction. For example, clicking in a text field of a form generates an onFocus event.

onHelp (IE4, IE5) is generated when the visitor clicks the browser's Help button or chooses Help from a browser menu.

onKeyDown (NS4, IE4, IE5) is generated as soon as the visitor presses any key. (The visitor does not have to release the key for this event to be generated.) The browser cannot detect which key has been pressed.

onKeyPress (NS4, IE4, IE5) is generated when the visitor presses and releases any key; this event is like a combination of the onKeyDown and onKeyUp events. The browser cannot detect which key has been pressed.

onKeyUp (NS4, IE4, IE5) is generated when the visitor releases a key after pressing it. The browser cannot detect which key has been pressed.

onLoad (NS3, NS4, IE3, IE4, IE5) is generated when an image or page finishes loading.

onMouseDown (NS4, IE4, IE5) is generated when the visitor presses the mouse button. (The visitor does not have to release the mouse button to generate this event.)

onMouseMove (IE3, IE4, IE5) is generated when the visitor moves the mouse while pointing to the specified element. (That is, the pointer stays within the boundaries of the element.)

onMouseOut (NS3, NS4, IE4, IE5) is generated when the pointer moves off the specified element. (The specified element is usually an image, or a link attached to an image.) This event is often used in conjunction with the Swap Image Restore behavior to return an image to its original state when the visitor is no longer pointing at it.

onMouseOver (NS3, NS4, IE3, IE4, IE5) is generated when the mouse first moves to point to the specified element (that is, when the pointer moves from not pointing to the element to pointing to the element). The specified element for this event is usually a link.

onMouseUp (NS4, IE4, IE5) is generated when a pressed mouse button is released.

onMove (NS4) is generated when a window or frame moves.

onReadyStateChange (IE4, IE5) is generated when the state of the specified element changes. Possible element states include uninitialized, loading, and complete.

onReset (NS3, NS4, IE3, IE4, IE5) is generated when a form is reset to its default values.

onResize (NS4, IE4, IE5) is generated when the visitor resizes the browser window or a frame.

onRowEnter (IE4, IE5) is generated when the current record pointer of the bound data source has changed.

onRowExit (IE4, IE5) is generated when the current record pointer of the bound data source is about to change.

onScroll (IE4, IE5) is generated when the visitor scrolls up or down.

onSelect (NS3, NS4, IE3, IE4, IE5) is generated when the visitor selects text in a text field.

onStart (IE4, IE5) is generated when a marquee element's contents begin a loop.

onSubmit (NS3, NS4, IE3, IE4, IE5) is generated when the visitor submits a form.

onUnload (NS3, NS4, IE3, IE4, IE5) is generated when the visitor leaves the page.