Jquery has a validation library. Plus there are many others too. Google for Javascript form validation.
Unfortunately, some validations require more access to the business rules of your app in your browser/JS code. So you'll then have to weigh the costs of duplicating business logic in your JS vs the benefit of the immediate feedback to the user.
Just be sure not to skimp on implementing your business rules (and testing them) in your server-side sw first. Remember that clients can never be trusted--even the clients that you write yourself!