-
Martinez_MicaelaAsked on May 8, 2024 at 12:29 PM
Hello, I have a question and would like to know if it's possible to create a condition where if the date of birth is less than 18 years of age a question is shown, but if the age is 18 years or older than the question is show and required to be completed. I understand that this will include multiple conditions to be created but the main one I need assistance will be with the first part "date of birth is less than 18 years of age a question is shown/Hidden"
Thank You in advance
Page URL: https://form.jotform.com/241242757630151 -
Carlo JotForm SupportReplied on May 8, 2024 at 1:35 PM
Hi Micaela,
Thanks for reaching out to Jotform Support. You can achieve this by setting up two Date fields, using the Form Calculation widget and conditions to show or hide the fields based on the calculated value. Check out the steps and screencast below to see how it's done:- Add two Date Picker fields to your form.
- Set the first Date Picker field as Current and the second as the Date of Birth field.
3. Next, add the Form Calculation widget to perform calculations for age.
4. Set the calculation for the Form Calculation widget, as shown below:
floor((Current Date - Date of Birth) / 365)
5. Finally, use Show / Hide Field conditional logic to show whether the user is under or over the
age of 18.
You can also check out my demo form and see if it fits your requirements. You can clone my form to check the conditions and form calculation.Give it a try and let us know how it goes.