prevent overlapping dates

  • liferaft
    Asked on March 31, 2020 at 4:58 PM

    On a form with multiple dates, is there anyway to set it up so that one date box cannot precede another. See form, scroll down to GIST HISTORY - There is a GIST Diagnosis date #1 and there is a Misdiagnosis Date on the next line. The first date cannot be before the second date yet some people accidentally fill it in wrong. Looking to see if there's a way to set this up.


  • John Support Team Lead
    Replied on March 31, 2020 at 7:14 PM

    You can use this guide below for this type of requirement:

    GUIDEHow-to-Use-the-Date-Limits-Option 

    What I can suggest is to have a specific range of dates that will be available for each field to avoid overlapping.

    Say you'll enable only a specific range of dates from the first date field then disable that range into the second field.

    Please try that and let us know how it goes.

  • liferaft
    Replied on April 1, 2020 at 4:39 PM

    Ok I don't see anything that addresses non-specific date requirements or interactivity between to date pickers - is there another function or app that I could use to achieve my objective?


  • John Support Team Lead
    Replied on April 1, 2020 at 5:59 PM

    I think this can be achieved using conditions. Let me conduct a few more test about this and revert on this thread shortly.

  • John Support Team Lead
    Replied on April 2, 2020 at 4:56 PM

    Thank you for waiting!

    Since there is no direct option to automatically disable some dates into a date picket field based on another field's data, I came up with a solution to just warn or inform the user that he's selecting an invalid date.

    Here's what I came up with:

    1. Add a FORM CALCULATION widget to the form. We will calculate the difference between the two date fields (GIST Diagnosis date - Misdiagnosis date):

    prevent overlapping dates Image 10

    GUIDEHow-to-Perform-Form-Calculation-Using-a-Widget 

    2. Then add a TEXT field that will contain your message to the user (shown in the screenshot above in RED).

    3. Add a condition to show the said message based on the difference of the said date fields. If it's less than 1, it means that the Misdiagnosis Date is the same or is later than the GIST Diagnosis Date, which is not allowed.

    15858609102235545 2 Screenshot 21

    You can just hide the FORM CALCULATION widget to your form so the user won't be able to see it.

    I have implemented this into a cloned form. Here's a link to it:

    https://form.jotform.com/200926272602954 

    Please try this and let us know how it goes.