Section 25.135. Form.onsubmit: event handler invoked when a form is submitted


25.135. Form.onsubmit: event handler invoked when a form is submitted

DOM Level 0

25.135.1. Synopsis

 Function onsubmit 

25.135.2. Description

The onsubmit property of a Form object specifies an event-handler function that is invoked when the user submits a form by clicking on its Submit button. Note that this event handler is not invoked when the Form.submit( ) method is called.

If the onsubmit handler returns false, the elements of the form are not submitted. If the handler returns any other value or returns nothing, the form is submitted normally. Because the onsubmit handler can cancel form submission, it is ideal for performing form data validation.

See Element.addEventListener( ) for another way to register event handlers.

25.135.3. See Also

Element.addEventListener( ), Form.onreset, Form.submit( ); Chapter 17




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net