javascript validate on submit

In this example, if you don't enter something in the name field, javascript doesn't submit the form, but rather displays various error indicators.

*
  
  * denotes required field

Naturally you would make this all very pretty for real customers.