| onMoveExecutes JavaScript code when a move event occurs; that is, when the user or script moves a window or frame.
Event handler for | Window | Implemented in | Navigator 4.0 |
SyntaxonMove="handlerText" Parameters
handlerText
| JavaScript code or a call to a JavaScript function. |
Event properties used
type | Indicates the type of event. | target | Indicates the object to which the event was originally sent. | screenX, screenY | Represent the position of the top-left corner of the window or frame. |
See alsoFor general information on event handlers, see "General Information about Events". For information about the event object, see event .
onResetExecutes JavaScript code when a reset event occurs; that is, when a user resets a form (clicks a Reset button).
Event handler for | Form | Implemented in | Navigator 3.0 |
SyntaxonReset="handlerText" Parameters
handlerText
| JavaScript code or a call to a JavaScript function. |
ExamplesThe following example displays a Text object with the default value "CA" and a reset button. If the user types a state abbreviation in the Text object and then clicks the reset button, the original value of "CA" is restored. The form's onReset event handler displays a message indicating that defaults have been restored.<FORM NAME="form1" onReset="alert('Defaults have been restored.')"> State: <INPUT TYPE="text" NAME="state" VALUE="CA" SIZE="2"><P> <INPUT TYPE="reset" VALUE="Clear Form" NAME="reset1"> </FORM> Event properties used
type | Indicates the type of event. | target | Indicates the object to which the event was originally sent. |
See alsoForm.reset , Reset For general information on event handlers, see "General Information about Events". For information about the event object, see event .
onResizeExecutes JavaScript code when a resize event occurs; that is, when a user or script resizes a window or frame.
Event handler for | Window | Implemented in | Navigator 4.0 |
SyntaxonResize="handlerText" Parameters
handlerText
| JavaScript code or a call to a JavaScript function. |
Event properties used
type | Indicates the type of event. | target | Indicates the object to which the event was originally sent. | width, height | Represent the width and height of the window or frame. |
DescriptionThis event is sent after HTML layout completes within the new window inner dimensions. This allows positioned elements and named anchors to have their final sizes and locations queried, image SRC properties can be restored dynamically, and so on. See alsoFor general information on event handlers, see "General Information about Events". For information about the event object, see event .
onSelectExecutes JavaScript code when a select event occurs; that is, when a user selects some of the text within a text or textarea field.
SyntaxonSelect="handlerText" Parameters
handlerText
| JavaScript code or a call to a JavaScript function. |
Event properties used
type | Indicates the type of event. | target | Indicates the object to which the event was originally sent. |
ExamplesThe following example uses onSelect in the valueField Text object to call the selectState function.<INPUT TYPE="text" VALUE="" NAME="valueField" onSelect="selectState()"> See alsoFor general information on event handlers, see "General Information about Events". For information about the event object, see event .
onSubmitExecutes JavaScript code when a submit event occurs; that is, when a user submits a form.
Event handler for | Form | Implemented in | Navigator 2.0 |
SyntaxonSubmit="handlerText" Parameters
handlerText
| JavaScript code or a call to a JavaScript function. |
SecurityNavigator 4.0: Submitting a form to a mailto: or news: URL requires the UniversalSendMail privilege. For information on security in Navigator 4.0, see Chapter 7, "JavaScript Security," in the JavaScript Guide. DescriptionYou can use onSubmit to prevent a form from being submitted; to do so, put a return statement that returns false in the event handler. Any other returned value lets the form submit. If you omit the return statement, the form is submitted. Event properties used
type | Indicates the type of event. | target | Indicates the object to which the event was originally sent. |
ExamplesIn the following example, onSubmit calls the validate function to evaluate the data being submitted. If the data is valid, the form is submitted; otherwise, the form is not submitted.<FORM onSubmit="return validate(this)"> ... </FORM> See also the examples for Form . See alsoSubmit , Form.submit For general information on event handlers, see "General Information about Events". For information about the event object, see event .
onUnloadExecutes JavaScript code when an unload event occurs; that is, when the user exits a document.
Event handler for | Window | Implemented in | Navigator 2.0 |
SyntaxonUnload="handlerText" Parameters
handlerText
| JavaScript code or a call to a JavaScript function. |
DescriptionUse onUnload within either the BODY or the FRAMESET tag, for example, <BODY onUnload="..."> .In a frameset and frame relationship, an onUnload event within a frame (placed in the BODY tag) occurs before an onUnload event within the frameset (placed in the FRAMESET tag). Event properties used
type | Indicates the type of event. | target | Indicates the object to which the event was originally sent. |
ExamplesIn the following example, onUnload calls the cleanUp function to perform some shutdown processing when the user exits a Web page:<BODY onUnload="cleanUp()"> See alsoonLoad For general information on event handlers, see "General Information about Events". For information about the event object, see event . |
| |