Limit Date Range based on Second Date Range

  • Profile Image
    silver007
    Asked on August 18, 2015 at 08:22 AM

    if we have two date and time widget:

    Date of visit

    Date of discharge

    i know how to limit the date to the past or future, but what i need is to set the (Date of discharge) doesn't exceed the date was selected in the (date of visit), i mean from the date was selected in the (date of visit) till the recent date.

    regards. 

     

  • Profile Image
    KadeJM
    Answered on August 18, 2015 at 04:37 PM

    From what I understand of your request you mean that you want to find a way to make it so the First Date's Limit is not ahead of the discharge date? Is that correct? Or?

    Could you possibly explain this further or provide us with a written example so that we can get a better idea of what you seek?

    Currently what I am under the impression is that say Discharge Date was 8/19/15 then do you mean you want to have the Visit Date not go past that date? Or?

    Please confirm or correct me if needed.

  • Profile Image
    silver007
    Answered on August 19, 2015 at 12:02 AM

    ok thanks Mr. Kade,

    I will say that the date of visit or admission is on 8/19/15, then i want the date of dischrge to be after 8/19/15 and before today.

    many thanks  

  • Profile Image
    BJoanna
    Answered on August 19, 2015 at 04:38 AM

    Unfortunately, you can not prevent users to choose "date of discharge" that is before "date of visit".

    Possible workaround is to add  Form calculation field that will calculate difference between dates and then if calculation is 1 or less you can use conditional logic to hide submit button so your users will not be able to submit your form if "date of discharge" is before "date of visit".

    http://www.jotform.com/help/259-How-to-perform-calculation-in-the-form  

    Here is my demo form: http://form.jotformpro.com/form/52302441507949? 

    Feel free to clone it if you want to take a closer look to my condition.

    Hope this will help. Let us know if you need further assistance.