Fields‎ > ‎

Custom Field Validations

The ePly registration system allows you to create custom validations that can be used to force registrants to enter data in a specific format such as a date (MM/DD/YYYY).

To create a custom validation:
  1. Click into text box or text area field
  2. Click 'add validation'
  3. Set the type to 'custom'
  4. Click save, you will now see a box for valid expression.
  5. Enter a regular expression for the validation you need.  This requires an understanding of regular expressions.  If you aren't familiar with writing regular expressions, use one of the samples below, or try searching in Google for the type of expression you need.
  6. Enter an appropriate error message
  7. Save your work and test the expression

Regular Expressions

When you copy and paste the expressions below, be sure to use the exact expression without any extra spaces or it will not work.

 Type Matches Allowed Expression
Date MM-DD-YYYY12 31 2001

12-31-2001

12.31.2001

12/31/2001

^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$
Date DD-MM-YYYY31 12 2001

31-12-2001

31.12.2001

31/12/2001

^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$
Date dd-mmm-yyyy12-jan-2001
12-Jan-2001
12-JAN-2001 etc.
(?i)^(0[1-9]|[12][0-9]|3[01])[- /.](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[- /.](19|20)\d\d$


To create a validation for a dollar amount such as $1,234.33, use:    ^\$?(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$
     - This expression allows the user to omit the $ sign, comma separator, and trailing cents.

To create a validation for a specific number of digits allowed in a field, use .*\b\d{12}\b.* (Note - the number in the { } indicates the number of digits allowed, therefore the example used allows for 12 digits)

To create a validation for a specific number range (useful for validating things like membership numbers), use the following online tool, courtesy of utilitymill.com: http://utilitymill.com/utility/Regex_For_Range


 


Comments