sean.fiene@nintex.com

Fun with Forms: Date Validation

Blog Post created by sean.fiene@nintex.com Support on Apr 22, 2015

When using Nintex Forms for submissions of surveys, promotions, or orders where a user must meet a certain age, Nintex Forms has you covered with Validation rules. For this example, we are opening a contest for a free bottle of a tasty beverage (which in the United States requires you to be 21 years old).

 

superAwesomeForm.jpg

If a user enters a birth date that is less than 21 years old, they will receive an error message:

 

superAwesomeFormwithError.jpg

To create a validation rule against the Date Picker control, we need to write a rule around the length of one day. To do that, you can use a calculated value control:

 

CalcVal.jpg

 

“Birthday” in the Formula field is the DatePicker control, named “Birthday”.

When previewing the form you will see that calculations of dates through integers are in milliseconds.

 

calcvalueRuntime.jpg

Now that we know the value of a date picker control, we can build a form variable to get the value required (NOTE: ensure data type is Integer):

 

formVariable.jpg

 

We can then build a Validation rule as follows to ensure that the Form Variable “birthdayCheck” is greater than 662688000.

 

ValidationRule.jpg

Outcomes