What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How can we include condition on the return date cannot be before the departure dat

    Asked by fredpiq on September 01, 2016 at 10:07 AM
    4. how can we include condition on the calendar => the return date cannot be before the departure dat
  • Profile Image
    JotForm Support

    Answered by Boris on September 01, 2016 at 10:32 AM

    Yes, we can achieve your requirement by using a Form Calculation field to calculate the difference between the two date fields, and a Text field to display an error message to your users if the difference is less than 1 day..

    Step 1. We need to add a Form Calculation, and set it to calculate the "Date of Return minus Date of Departure":

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

    We can set this field as hidden, so that it does not confuse your users:

    Step 2. We should add a Text field, which will contain the error message you want to show to your users when they pick the arrival date that is prior to departure:

    Step 3. Finally, we use a single show condition to display our custom error message if the calculation is less than 0, meaning the arrival date is not after the departure date:

    https://www.jotform.com/help/57-Smart-Forms-Using-Conditional-Logic

    This rule should also have a hide action added, where it hides the Submit button during the error:

    You can see a demo form with these steps applied here:

    https://form.jotformpro.com/form/62444057214955

    Please try the above steps, and if you need further assistance, please let us know.