This page provides examples of the Spry Confirm Validation widget capabilities.
In the first example, there is a Confirm widget for each password widget field. The confirm widget verifies that the entered value for the password widget is the same as the value in the confirm password field. The validation event can be 'onChange' - this means the validation will be triggered as you type, or 'onBlur' - when the password field loses focus and lastly, ' onSubmit' - when the form is submitted. By default, all Spry Validation widgets validate onSubmit. 'onBlur' and 'onChange' are options.
The Confirm widget can be applied to a normal input field, so you can verify if the values from the two different text fields are identical. The following example shows how to verify if the email address is the identical between the two fields.
The following example shows a Textfield Validation widget to which is attached a Confirm validation widget that verifies that the two emails entered are identical. The textfiled widget is using the email format.
To provide more details to the user, you can add an additional error message for it. The example below shows how to set an additonal error message to the Confirm widget. The password field is a normal input field with type set on password.
The following example shows how to change the default appeareance for error messages. Spry overwrites the default CSS classes for error messages by adding new properties for these classes. In this example, the error message color should be blue.
You can also change the widget container to use the textfield label tag as anerror message.