onClickevent handler. Through this event handler, form data can be "pre-processed" just before it is submitted.
For example, suppose that a form's text field is used to submit the user's first name. Suppose also that we want the first names written in all capital letters. The following code shows how we can use the submit button's
onClick event handler to accomplish this:
Note, however, that the submit button's
onClick event handler cannot be used to cancel the submit. To control whether or not a form is submitted, use the form's