How to select an option in the dropdown depending on the date?

  • Klearc
    Asked on September 17, 2024 at 12:20 AM

    I have 2 part (Dropdown list and Apply Date).

    I want to know. how to make it automatically linked? E.g. If today is 17-Sep-2024, then the label is SEP (September)??


    Part 1 - Label - Dropdown list (from January to December)

    How to select an option in the dropdown depending on the date? Image 1 Screenshot 30


    Part 2 - Date (Apply Date)

    How to select an option in the dropdown depending on the date? Image 2 Screenshot 41

  • Joshua_T JotForm Support
    Replied on September 17, 2024 at 3:03 AM

    Hi Chan,

    Thanks for reaching out to Jotform Support. Automatically selecting an option from the dropdown menu depending on the date is easy. Let me show you how:

    1. In Form Builder, click on Settings from the top bar menu, and click on Conditions from the left panel menu.
    2. Then, select Update/Calculate Field Condition. How to select an option in the dropdown depending on the date? Image 1 Screenshot 50
    3. Finally, copy these conditions below for SEP and OCT. You can follow the same format for the other months.

    For SEP:

    How to select an option in the dropdown depending on the date? Image 2 Screenshot 61

    For OCT:

    How to select an option in the dropdown depending on the date? Image 3 Screenshot 72

    Check out this screencast below:

    How to select an option in the dropdown depending on the date? Image 4 Screenshot 83

    Give it a try and let us know how it goes.

  • Klearc
    Replied on September 17, 2024 at 10:42 AM

    If you calculate like this, it have to update 1 year 1 time.

    because now is 2024. How about 2025?


  • Joshua_T JotForm Support
    Replied on September 17, 2024 at 11:07 AM

    Hi Chan,

    Unfortunately, for the conditional logic to properly work, you will need to recreate the conditions for the next years.

    Reach out again if you have any other questions.

  • Klearc
    Replied on September 17, 2024 at 10:28 PM

    Can you have any widget that can only take out the month?

  • Sheena JotForm Support
    Replied on September 18, 2024 at 2:39 AM

    Hi Chan,

    Currently, there aren't any widgets that can automatically extract the month in words from the date picker field. You'll need to create the conditions manually. However, if you only need the month as a number, you can use the substring widget. An example of this can be found on the other thread. If this works for you and you need assistance setting it up in your form, please let us know.

    Keep us updated and let us know if you need any more help.

  • Sheena JotForm Support
    Replied on September 18, 2024 at 2:55 AM

    Hi Chan,

    I found a workaround to insert values on a dropdown field based on the value in the substring widget. Please clone this demo form to inspect how it is set up. How to select an option in the dropdown depending on the date? Image 1 Screenshot 50

    Cloning forms using a form URL is easy to do. Let me walk you through it:

    1. Open your My Forms page and click on Create Form on the top-left side of the page.

    How to select an option in the dropdown depending on the date? Image 2 Screenshot 61

    2. In the window that opens up, click on Import Form

    How to select an option in the dropdown depending on the date? Image 3 Screenshot 72

    3. In the next window, click on From a Webpage

    4. Paste the form link into the Enter URL field and click on Create Form.

    How to select an option in the dropdown depending on the date? Image 4 Screenshot 83

    After cloning your form, it'll open up in Form Builder automatically. Now, you can edit the way you want it and publish it.

    Give it a try and let us know if you need any other help.

Your Answer