Limiting dates based on a date enetered in another field

  • Profile Image
    orangetheoryfitnessnaples
    Asked on December 09, 2016 at 03:52 PM

    How can I limit the suspension end date to between 30 after suspension start date and 60 days after suspension start date. 

  • Profile Image
    Boris
    Answered on December 09, 2016 at 05:40 PM

    Yes, this functionality is possible in the following way.

    1. We add a custom error message to the form, by using a Text field:

    2. We perform a calculation to get the difference between the End Date and Start Date:

    https://www.jotform.com/help/259-How-to-Perform-Form-Calculation-Using-a-Widget

    Two things about the calculation.

    2a. We should set it to "Wait for input before including the field in calculation":

    2b. This Form Calculation field can be hidden on the form, but I'll leave it visible in the demo. To hide the field, click its down-pointing arrow, and click Hide Field:

    3. Finally, we set up a show/hide condition to show our custom error message and hide the Submit button if the calculation is less than 30 or greater than 60:

    https://www.jotform.com/help/316-How-to-Show-or-Hide-Fields-Base-on-User-s-Answer

    Please see the following demo form of the above setup to check whether the above explained setup is working to your satisfaction:

    https://form.jotformpro.com/form/63436699755979

    If you need further clarifications or assistance, please let us know.

  • Profile Image
    orangetheoryfitnessnaples
    Answered on December 10, 2016 at 08:56 AM

    Thank you!