25.135. Form.onsubmit: event handler invoked when a form is submittedDOM Level 025.135.1. SynopsisFunction onsubmit 25.135.2. DescriptionThe 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 AlsoElement.addEventListener( ), Form.onreset, Form.submit( ); Chapter 17 |