CSValidation | Vaadin

Client-side validation of text fields

The CSValidator component extension allows client-side validation of TextField, PasswordField, and TextArea components. The field value is validated after each key press without any client-server communication.

You have two options for validating the values: regular expressions and JavaScript. The JavaScript return value can also be used to create counters in text fields and areas. The library comes with special JavaScriptEditor and RegExpEditor components, which allow you to develop and test JavaScript and regular expression validators easily. The editors are also available in the demo.

The add-on is installed as a JAR, which includes the JavaDoc for the server-side API. You need to compile the widget set.

The version 0.5 and later support Vaadin 7, and come as a component extension, which you can attach to a text field with extend(). For Vaadin 6 compatibility, use version 0.4.x, which offers three components instead of an extension: CSValidatedTextField, CSValidatedPasswordField, and CSValidatedTextArea. The functionality is exactly the same.

The add-on should be considered as beta, as compatibility is not tested with IE, but it probably works.


Link to this version
BetaReleased 17 April 2011Apache License 2.0
Framework Support
Vaadin 6.5+
Also supported:
Vaadin 7 (0.5.6)
Browser Compatibility
Install with
Release notes - Version 0.4.1

Fixed invalid JAR. Most files were lost because of the com->org change in packaging.

Changes in 0.4:

  • Changed package name from com.vaadin.csvalidation to org.vaadin.csvalidation.
  • Validate also empty values with regular expressions (support for example [0-9]*), unless disabled with setValidateEmptyValue(false).
  • Fixed a problem with span elements, for example in CssLayout.
  • Compiled with Vaadin 6.5.4 and GWT 2.1.1, but could work with earlier versions as well.