Jetformbuilder: Minimum age validation
- By
- John Doe
- Sept 17, 2024
- 7 min read
Short Intro:
You’re using JetFormBuilder and want to make sure users are at least 18 years old based on their birthday input.
Problem:
You need a way to check if the selected birthdate means someone is 18+ today, and block the form if they’re not.
Solution:
This solution is assuming you already installed Jetformbuilder plugin and know how to create a form.
- Add a date field.
- In the date field Block settings, go to limit dates and add ‘%CT::CurrentDate%’ – 568036800000.
- Enable Field > Is Timestamp.
- In validation > Validation Type, select Advanced and add the messages you want to use.
Notes:
- The form will only accept dates before or equal to the calculated date.
- %CT::CurrentDate% macro will return current day in timestamp format.
- 568036800000 is in milliseconds which is approximately equal to 18 years.
- You can add “Starting from date” value if you want to use a maximum age.
- Make the date field required so they cannot submit the form unless the date field is valid.
Contact Details
More solutions
by ilias
Roweij Specerijen wanted to have a filter that can choose number of products display per pagination
by ilias
This article will show you how to add dynamic code to your templates using the Elementor Shortcode widget and custom PHP code.
by ilias
This article will show you how to add an image to invoice and slip PDF template in PDF Invoice & Packing Slips for Woocommerce plugin

