onSubmit (Event handler)

The user has clicked on the submit button in a form.


JavaScript - 1.1
JScript - 3.0
Internet Explorer - 3.0
Netscape - 2.0
Opera browser - 3.0
Property/method value type:Boolean primitive
JavaScript syntax:-myObject.onsubmit = aHandler
HTML syntax:<FORM onSubmit="..."> <HTMLTag onSubmit="...">
Argument list:aHandlerA reference to a function object to handle the event

As the <FORM> submit button is clicked, this event is triggered. If you return the value true, the event will be passed to the browser for further processing and the form will be submitted. Returning false inhibits this action and discards the message; the form will not be submitted. This provides a means of inhibiting <FORM> submits when the form data is bad.

You can later on call the submit() method to send the form content back to the server.

Note that the submit() method will not trigger an onSubmit event.

See also:Event, Event handler, Event model, Event names, Event object, Event.returnValue, Handler, onClick, onMouseDown, onMouseUp, onReset, Semantic event

Supported by objects: