Event handler for Form
code whenever the user submits a form, and as such, is included within
the HTML <FORM> tag. The onSubmit event handler uses the
following properties of the Event object:
type - indicates the type of event.
target - indicates the target object to which the event was sent.
In the following example, the onSubmit event handler calls
the 'submitEvent' function:
If you want to validate the information in the form and only allow
it to be submitted if it meets your requirements, you will need to put
a return statement that returns false in the event handler,
as in the following example using the 'validate' function:
<FORM onSubmit="return validate(this)">