In this example, the JavaScript is used to check the contents of a form before shipping it to the server.