Get the age automatically from birth date

  • viper.oliver
    Asked on March 25, 2020 at 9:34 PM

    Also, can you make the birth date automatically populate the age on the form?

  • Elton Support Team Lead
    Replied on March 25, 2020 at 9:39 PM

    We do not have a specific widget that calculates age but there's a workaround using form calculation.

    Demo: https://form.jotform.com/61880675038968

    Feel free to clone this form so you can figure out the whole setup. Guide: https://www.jotform.com/help/28-Cloning-a-Form-from-a-Web-Page

    Here's how I did it:

    1. You need are 2 Date Picker fields and 2 Form Calculation Widgets in your form

    Get the age automatically from birth date Image 1 Screenshot 50

    Get the age automatically from birth date Image 2 Screenshot 61

    2. In the 2 Form Calculation Widgets, you need to define formula on each of them. The first calculation field (Days) gets the number of days, here's the formula:

    Get the age automatically from birth date Image 3 Screenshot 72

    In the second calculation field (Age), this will calculate the Age base from the given birth date by the user using the math Floor function.

    Get the age automatically from birth date Image 4 Screenshot 83

    If you need further assistance, let us know.