Cornerstone Forms Validations

Validations are a way to prevent bad data in a visual manner. In this article we explain all available Validations.

  1. The Basics
  2. Required
  3. Character Comparison
  4. Date
  5. Email
  6. Nonce
  7. Number Comparison
  8. ValidChoices
  9. See Also

The Basics

Click on the validations input to show the list of validations. Each validation can have it's own custom error message.

Validations Controls

Required

One of the most simple validation, this will check if there is any data for the input.

Character Comparison

This is validation can check the data has a certain number of characters. This can be useful if you want to ensure the user will send you at least 100 characters. Or if you want to prevent long messages by having less then 100 characters.

Date

An example here would be if you want to age-gate a form or page for people over the age of 21.

Email

This validation checks if the input is a valid email. This uses the WordPress function is_email internally.

Nonce

This is a very specific validation that uses the wp_verify_nonce function. You should use the Nonce prefab if you want a Nonce added to your form as it will setup everything for you.

Number Comparison

You can use this validation to ensure a number if equal, greater, or less than a validation number. Using two of these validation can get you a valid range of numbers using greater and less then.

ValidChoices

If you want a certain number of answers, you can use this validation to have answers within the choices. When using the Select element and Radio and Check list elements this is unnecessary and will check if the data is in the valid options.

See Also

See something inaccurate? Let us know