How to create conditions for age requirements for my form?

  • brian.valle
    Asked on June 27, 2024 at 7:46 PM

    I have a student registration form.

    To be eligible to take the class, they need to be at least 15 & 9 months.

    They enter their birthdate earlier on in the form.

    They need to choose a class they would like to participate in. (Classroom Session Month - pg 2)

    How do I hide the classes in the dropdown menu that they can't take because they aren't old enough?

  • Mary Eden JotForm Support
    Replied on June 27, 2024 at 9:45 PM

    Hello Brian,

    Thanks for reaching out to Jotform Support. I understand your form request but I’ll need a bit of time to look into this and create a demo form. I’ll get back to you as soon as I can.

    Thanks for your patience and understanding, we appreciate it.


  • Mary Eden JotForm Support
    Replied on June 27, 2024 at 11:28 PM

    Hello Brian,

    Setting an age limit in Date of Birth is enough as it prevents your respondents from moving on to the next pages. But, if you want to let your respondents continue filling out the form, and just hide Page 2 which contains your classes when the age limit isn't met, then just remove the minimum age in the Date of Birth, and follow the steps below:

    1. In the Form Builder, click +Add Form Element from the left side of the screen.

    2. Add one more Date Picker element on the form and set its default date to Current.

    How to create conditions for age requirements for my form? Image 1 Screenshot 60

    3. Hide the Date Picker that we just added.

    4. Click on +Add Form Element again. and go to the Widgets Tab.

    How to create conditions for age requirements for my form? Image 2 Screenshot 71

    5. Click the Wand Icon of the Form Calculation Widget then, enter the Formula as per the screenshot below and click on Save.

    How to create conditions for age requirements for my form? Image 3 Screenshot 82

    6. To hide Page 2, we will add a Conditional logic. Click on Settings in the orange navigation bar at the top of the page, 

    7. Click on Conditions on the left side of the page.

    8. Now, click on Add a New Condition and then click on Show/Hide Field.

    How to create conditions for age requirements for my form? Image 4 Screenshot 93

    Check out the screencast below to see my results:

    How to create conditions for age requirements for my form? Image 5 Screenshot 104

    Give it a try and reach out again if you have any other questions.

  • brian.valle
    Replied on June 28, 2024 at 7:52 PM

    So there are multiple options for them to select in terms of class schedules. They may not be eligible for the 1st class, but they could take the second class.

    ie: There is a class on July 8th, 2024 and July 22nd 2024. Their birthday is 10/10/2008. They can't take the 1st july class, but they can take the 2nd one.

    How could I make that work?

  • Marehlene_B JotForm Support
    Replied on June 28, 2024 at 8:57 PM

    Hi Brian,

    What I can suggest is that a separate dropdown be created for users under the age of 15 and 9months, and that dropdown be displayed only when their age does not meet the requirements. Let me show you how:

    • Create another Dropdown and only enter the options available to users who did not meet the age requirement. 

    How to create conditions for age requirements for my form? Image 1 Screenshot 50

    • Set up a Show/Hide field condition. Then, follow the condition in the screenshot.

    How to create conditions for age requirements for my form? Image 2 Screenshot 61

    • You should also remove the minimum age from your Date of Birthfield. 

    How to create conditions for age requirements for my form? Image 3 Screenshot 72

    Check out the screencast below to see my results:

    How to create conditions for age requirements for my form? Image 4 Screenshot 83
    Here's a cloned form that you can test. You might also want to check out this guide about How to Show or Hide Fields Conditionally.

    Give it a try and let us know if you have any other questions.

  • brian.valle
    Replied on June 28, 2024 at 9:25 PM

    Ok, this is obviously not being understood correctly:

    I have a list of Classes and their start dates:

    Class 1: Starts July 8th

    Class 2: Starts July 22nd

    Class 3: Starts Aug 1st

    Class 4: Starts Aug 20th

    Students Must be 15 and 9 months on or before THE FIRST DAY OF CLASS. They don't have to be 15 and 9 months to sign up ahead of time, as long as they are 15 and 9 months before the first day of class.

    So if a Student was born on 10/12/2008, it means that they will be 15 and 9 months on July 12th 2024.

    They are not eligible to take Class 1, because they wont be 15 and 9 months on or before July 8th, but they will be for Class 2, 3, & 4.

    If they try to select Class 1, is there a way to create a Flag or some type of notification that they aren't old enough to attend that class based on their birthdate?

  • Marehlene_B JotForm Support
    Replied on June 28, 2024 at 10:03 PM

    Hi Brian,

    To meet your needs, you must specify a date range because your classes are not on different fields, but rather on the same field. 

    Regarding your other concern, it is not possible to show a notification or error in a dropdown. You can only use a paragraph field and then add a Show condition so that if they select Class 1, an error would show. 

    Let us know if you have any other questions.

 
Your Answer