Sitevision Developer
Log in

Log in

Default validation

By default, elements with the required attribute are validated.

Custom validation

To add custom validation, overwrite the default validation function.

To keep default validation and add additional validation, the internal function sv.validate should be called from the overwritten version.

The example below will add validation for email inputs and keep default validation for required fields.

Error messages

Custom validation functions might need to display error messages. The sv.addErrorMessages function will add them in a standardized fashion and allows easy revalidation on change.

Example

This example will add email validation and display custom error messages.

Did you find the content on this page useful?