Conditional section activated by age

  • Profile Image
    PASPOA
    Asked on February 16, 2021 at 03: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?

  • Profile Image
    EltonCris
    Answered on February 16, 2021 at 08: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.png

    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.png

    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.png

    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.png

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

    02172021_ZigWAFVXql.png

    If you need further assistance, let us know.

  • Profile Image
    EltonCris
    Answered on February 16, 2021 at 08: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