About validators

Validators check the user submitted values against a set of rules to see if they are valid. If the value is valid nothing happens, the next validator and form element will be checked for validity. If the value is not valid, the error messages generated by the Validator will be returned back to the user and the form will not be submitted. If the value submitted to every form element passes that form element’s validators then the entire form is valid and it is submitted.

There are 19 validators included with the form, although you are free to add as many as you want – see the page Creating a custom validator.

  • alpha – The value must have only alphabet characters
  • alphaNumeric – The value must have only alphanumeric characters
  • captcha – The value must match the CAPTCHA token in session (used with the guide Using a custom CAPTCHA)
  • date – The value must be a valid date (used with the Date element)
  • digits – The value must be only digits
  • email – The value must be a valid email address
  • emailConfirm – The value must match the email address given in another field (used with the guide Confirm email element)
  • fileUpload – Validates the file upload against set options
  • greaterThan – The value must be greater than the set min (numerically)
  • honeypot – The value must be empty (used with the guide Using a Honeypot captcha)
  • identical – The value must be identical to the set token
  • inArray – The value must be in the given array
  • lessThan – The value must be less than the set max (numerically)
  • recaptcha – The value is validated by the reCAPTCHA service (used by the guide Using reCAPTCHA)
  • regex – The value is validated by the given regular expression pattern
  • required – The value is required and it cannot be empty
  • stringLength – The length of the value must be between the set min and max
  • time – The value must be a valid time (used with the Time element)
  • wordCount – The word count of the value must be between the set min and max

See also

Still having trouble? Head over to the forums.

Forums