Conditional section activated by age

  • PASPOA
    Asked on February 16, 2021 at 3:30 PM

    Hi!

    I would like to have a form that based on the date entered (birthday) we could get the age of the person and based on that age go to a particular section of the form.


    Is this possible? Has it been done before? Does the birthday widget does that or works with it?

  • Elton Support Team Lead
    Replied on February 16, 2021 at 8:42 PM

    Yes, that's possible. Demo: https://form.jotform.com/210467886689072. Feel free to clone this demo form too so you can inspect it further. Guide: How to Clone an Existing Form from a URL

    Here's how:

    1. Aside from the Birth Date Picker Widget you are using, you need to add a Date Picker field in your form then enable Current Date in its options. You can also hide this field so it is not visible in the live form. Example:

    02172021 WJVC0uVVgK Screenshot 10

    2. Add 2 Form Calculation Widgets. The first one will be used to calculate the number of days and the 2nd one is for the Age.

    02172021 L54dF7ZTN5 Screenshot 21

    3. Add a formula in the first form calculation widget (Days calculation widget). It should get the number of days, here's the formula:

    02172021 ftoKcA6LdB Screenshot 32

    4. Create an Update/Calculate condition that would calculate the age and output it to the Age field when the Birth Date Picker Field is filled.

    Here's how:

    02172021 0I8noGQEIC Screenshot 43

    Then create the following. The formula is floor(DaysField / 365.25)

    02172021 ZigWAFVXql Screenshot 54

    If you need further assistance, let us know.

  • Elton Support Team Lead
    Replied on February 16, 2021 at 8:43 PM

    By the way, if you want to show/hide fields based on the Age result, that's possible through show/hide condition. Here's how: How to Show or Hide Fields Base on User's Answer