What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Can Fields Be Shown or Hidden Based on a Default or Selected Date?

    Asked by hangingout on September 23, 2015 at 08:34 AM

    Meaning if I have a drop down box, that I want to include just the next 3 months, is it possible to do that.

    So if it is september now, the box would drop down, OCT, NOV, DEC. But next month the drop down would be NOV, DEC, JAN

    date conditions show/hide conditions based on date depending on date starts with
  • Profile Image
    JotForm Support

    Answered by abajan on September 23, 2015 at 01:44 PM

    Yes, this is possible. Please have a look at this form which you would recognize as being based on yours. If you were to clone it, you would notice that numbers are appended to the labels of the month fields. This was just to avoid any confusion while creating the conditions:

    However, once conditions have been tested and have been found to be functioning correctly, those numbers can be removed.

    To achieve the show/hide dropdown functionality what I did was:

    1. Add 12 month dropdowns and edit their options accordingly

    2. Insert a Form Calculation widget (See our widget guide)

    3. Add the second date field to its work area and then click 0-9 to change it to a-z and the button from orange to grey:


    4. Create 12 conditions attached to that widget to capture the first two (2) digits (the month) of the the date. The Form Calculation widget was necessary because there's no Starts With condition available for date fields:


    5. Hide the calculation field:


    6. Set the form to clear fields on their being hidden:

    This is necessary so that if a selection is made in a month field and then that field becomes hidden if a different date is selected in the date field, the selection is cleared.

    That's basically all I did but if you would like clarification on anything, please inform us.


    Thanks

  • Profile Image

    Answered by hangingout on September 24, 2015 at 12:47 AM
    Thanks, that is really helpful.
    ...
  • Profile Image
    JotForm Support

    Answered by Charlie on September 24, 2015 at 09:39 AM

    In behalf of my colleague, you are welcome. Glad to hear that the suggestion helped.

    Should you need any assistance again, feel free to open a new thread here in the forum.

    Thank you.