How do I limit the submissions to only 18 year old applicants?

  • Profile Image
    valeriaanissina
    Asked on August 11, 2019 at 05:59 AM

    I want to limit submission to only 18 year old applicants. Since the days differ yearly I cannot use today-6570. Is there a more bulletproof way? So 18 years ago would always be the same date as today.

    So if today is 11 august. then 18 years ago it would be 11 august as well, not 12 or 10 august



    This is a re-post of a comment on How to Use the Date Limits Option

  • Profile Image
    roneet
    Answered on August 11, 2019 at 06:13 AM

    Please allow me some time to work on the workaround.

    I'll get back to you in some time.

    Thanks

  • Profile Image
    roneet
    Answered on August 11, 2019 at 06:56 AM

    Here is the Demo Form that you can check:

    https://form.jotform.com/92222699859979

    1. 1. First, have two Datetime field. The 1st one will get the current date while the other is for the date of birth.

    2. Add a form calculation widget as the age field. We will do the calculation there.

    3. In my form calculation widget, this is the formula I have.

    floor((current date - date of birth)  / 365 days)

    floor - this will round your number value downward. You can check this link for the reference: http://www.jotform.com/help/267-Form-Calculation-Math-Function-Reference

    15655206231.PNG

    4. Add a condition to hide all the fields and show a text message if the age of the applicant is more than 18 years. This way the user would not be able to submit the Form.

    15655204661.PNG

    Result:

    1565520928form.gif

    I hope this workaround helps!

    Thanks.


  • Profile Image
    valeriaanissina
    Answered on August 11, 2019 at 08:18 AM

    Thank you so much for a quick reply. Unfortunately, it thinks 15th August 2001 is 18 years.

  • Profile Image
    Mike_G
    Answered on August 11, 2019 at 08:52 AM

    I would like to inform you that the Date Picker field has "Age" option on its properties under the LIMITS tab that I think would suit your needs.

    1565527427zt08_38_13.png

    The Date Picker field will show an error message and the form will not submit if your respondent's birthday is under the Age set in the field.

    1565527853zt08_50.gif

    I hope this helps. If you have other questions or concerns, please feel free to let us know.

  • Profile Image
    valeriaanissina
    Answered on August 11, 2019 at 08:57 AM

    Love it! Thank you for showing me the date picker. So simple :)