Validating the Age of your Submitters

Do you want only people over a certain age to fill out your form? This is possible with date field calculations.

To get started, add a Date field and a Number field to your form. Number fields can be found in the Basic Fields section of the builder, while Date/Time fields are found in the Advanced Fields section:

Screen_Shot_2019-06-18_at_9.41.39_AM.png

 

 Remove the 'Time' part of the Date/Time field by clicking the field and setting the 'Time Format' to -None- and Set the 'Allowed Years' to 'Current Year + 0 years' and Current Year - 100 years'.

 

Screen_Shot_2019-06-18_at_9.43.29_AM.png

 

 Next, click the Number field, go to the field options along the left of the page, scroll down to the Default Value box, and click 'Use Date Calculation':

This will convert the area into the date calculation builder. There are three different dropdowns that will appear: Value 1, Value 2, and 'Expected result in'. 

Screen_Shot_2019-06-18_at_9.45.39_AM.png

 Set the first dropdown to be the Date/Time field added to the form and set the second dropdown to the Current Date. The third drop-down determines what value the result will be calculated as: days, months, or years. Set it to 'Years'.

Finally, add a minimum value to the number field. This should be the age (in years) that the submitter needs to be in order to submit the form. In this example, I want the submitter to be at least 21 years old. The settings will look like this: 

Screen_Shot_2019-06-18_at_9.52.23_AM.png

 Optionally, you can hide the Age number field on your form so the submitter won't see the field on the form.

Screen_Shot_2019-06-18_at_9.48.51_AM.png

Now, when someone tries to fill out the form and is under the minimum age set an error is thrown.

Screen_Shot_2019-06-18_at_9.57.39_AM.png

 

Was this article helpful?
2 out of 3 found this helpful

Comments

0 comments

Please sign in to leave a comment.