w2form.onValidate

Called when validation of the form is needed.
onValidate = function(event)
This event is triggered when validation of the form is called. The event handler will receive a list of errors.
You can add event listener during the object creation: or after the object has been created: The event handler is called before the default action of the event is triggered. You can cancel the default action by calling event.preventDefault(). To perform an action after the event is fully processed, define event.onComplete function.
See events page in utilities for more details.

Example of Custom Validation

Lets say you want to make sure that registration date user provided is before the submission date. The following function will do this check and display error message if needed.

User Comments

comments powered by Disqus