The RichFaces Client Validation feature allows you to have true client side validation without writing a single line of JavaScript!

The standard JSF validators and JSR-303 (bean validation) constraints will be available on the client side just by adding <rich:validator/> to the desired inputs. If you are using any custom validators or extensions such as from hibernate an Ajax fallback mechanism will be used triggered. This will be basically seamless to the user, as an Ajax request will handle that specific validation. In future versions we plan to implement additional extensions such as these including custom client side validation. The behavior will try to execute all client validators available and then send an Ajax request to get results from server side if needed.

In this example we are using Bean Validation constraints and checking them at the client, so no requests are fired when typing values in the fields.

Notes:

- Some JSR-303 validators are not yet implemented for various reasons (localization primarily). As we complete these implementations they will work transparently after upgrading, plus Ajax fallbacks will work fine for these, so there is no reason not to start using them now!
- In future versions custom client side validators will be possible, and we'll update our examples to showcase them.