You may shift some load from the server and use Java Script e.g. to verify whether a user should leave a form.
<INPUT TYPE=SUBMIT VALUE="Good Bye" onclick="return confirm('Do you really want to say good bye?')">
The onSubmit handler can also be used to validate user input. If in the following snippet the function validate returns false the form is not submitted.
<FORM onSubmit="return validate(this)"> ... </FORM>