Limiting dates based on a date enetered in another field

  • orangetheoryfitnessnaples
    Asked on December 9, 2016 at 3:52 PM

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

    Jotform Thread 1007998 Screenshot
  • Boris
    Replied on December 9, 2016 at 5: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:

    Limiting dates based on a date enetered in another field Image 1 Screenshot 50

    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":

    Limiting dates based on a date enetered in another field Image 2 Screenshot 61

    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:

    Limiting dates based on a date enetered in another field Image 3 Screenshot 72

    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

    Limiting dates based on a date enetered in another field Image 4 Screenshot 83

    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.

  • orangetheoryfitnessnaples
    Replied on December 10, 2016 at 8:56 AM

    Thank you!