Date of birth field that is able to calculate the age of the person into another field

  • Clement Danternii
    Asked on January 29, 2019 at 8:36 PM

    Could you kindly help me with a Date of birth field that is able to
    calculate the age of the person into another field labelled age.
    Thank You
    ...

  • jherwin
    Replied on January 29, 2019 at 8:50 PM

    To calculate the age, you will be needing two date fields. One date field is where the date of birth is going to be entered and the other one is the one that will hold the current date or date today. You will also be needing a textbox field to display the output(age).

    To calculate the Age, subtract the "Date of Birth" date field value from "Current Date" date field value. The difference will be in days, so you need to divide the value by 365.25 days to get the year(s). 

    Guide: How to Insert Text or Calculation into a Field Using Conditional Logic

    You also need to get the value rounded down, that is why you will use the "floor()" math function. You need to do that so birthdays in November will not be counted as 1 if it's only August, for example.

    Here's a screenshot of calculation:
    1548812873dobcalc Screenshot 10

    Demo Form: https://form.jotform.com/90287899999995. You can clone this to know how it was done.

    Guide: How to Clone an Existing Form from a URL

    Let us know if you are referring to something different so we can check for possible options.

  • Clement Danternii
    Replied on January 30, 2019 at 7:43 AM
    Hello, again, that I got that fixed. Thanks to your team. Sorry but I am
    going to be a of a small bother to you. I am entirely new here. I want to
    add a unique code customizable to the form fields. that will be submitted,
    but not visible on the form. It will only be visible on the PDF document
    and the excel sheet that will be in our submission list. Where do I put
    that information?
    ...
  • Kevin Support Team Lead
    Replied on January 30, 2019 at 10:00 AM

    You can add a unique code to your form submissions, this guide will help you doing so: https://www.jotform.com/help/79-How-to-Add-Custom-Unique-IDs-to-your-Form-Submissions