Export (0) Print
Expand All

onsubmit event

Fires when a FORM is about to be submitted.

HTML 4.01 Specification, Section 18.2.3

Syntax

HTML Attribute <element onsubmit = "handler(event)">
Event Property object.onsubmit = handler;
attachEvent Method object.attachEvent("onsubmit", handler)
addEventListener Method object.addEventListener("submit", handler, useCapture)

Event information

SynchronousNo
BubblesNo
CancelableYes

Event handler parameters

pEvtObj [in]

Type: IHTMLEventObj

Standards information

Remarks

You can override this event by returning false in the event handler. Use this capability to validate data on the client side to prevent invalid data from being submitted to the server. If the event handler is called by the HTMLDocumentEvents4::onsubmit attribute of the form object, the code must explicitly request the return value using the return function, and the event handler must provide an explicit return value for each possible code path in the event handler function.

The IHTMLFormElement::submit method does not invoke the HTMLDocumentEvents4::onsubmit event handler.

Causes a form to be sent to whatever location is stipulated in the IHTMLFormElement4::action attribute of the form object.

To invoke this event, do one of the following:

The pEvtObj parameter is required for the following interfaces:

See also

Reference
IHTMLFormElement4::action
IHTMLFormElement::method

 

 

Community Additions

ADD
Show:
© 2014 Microsoft