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

    validation of two dates (from-to)

    Asked by unicefethiopia on June 30, 2014 at 10:15 AM


    I have a form where two dates should be entered (from - to) . The "To" date should be after the "From" date. 

    Is it possible to validate the second date to later than the first date? 


    Page URL:

  • Profile Image

    Answered by Carina on June 30, 2014 at 11:46 AM

    I tried a workaround using 3 form calculation fields. In the "from" calculation field I added the date "from" and did the same with the "to" field.

    I added a third calculation field (total) where I would subtract the calculation fields "to" - "from":

    I also added a Text field, under Form Tools with a warning message that will show if the "to" date is after the "from" date.

    I added a condition that if "total" is less than 0 show "error message":

    You can clone the test form if you wish:


    Let us know if this is a solution for you.

    Thank you

  • Profile Image

    Answered by unicefethiopia on July 02, 2014 at 04:53 AM

    Hi, thanks for the solution, 

    The only difference is the error message but it does not prevent submission of the form! 

    Is there a way to prevent the submission?

  • Profile Image
    JotForm Support

    Answered by jonathan on July 02, 2014 at 08:31 AM


    You can just use the condition to hide the Submit button if the selected dates is true.

    Example, if date FROM is after date TO which is false -- then hide submit button. This will prevent form submission base on condition.

    I also created a demo form http://www.jotform.me/form/41823271891457

    It only requires the From and To date field to calculate (lesser field requirement)

    The calculation is like this


    If you test the form, you will not be able to submit if the TO date is less than FROM date.


    Inform us if you need more assistance.



  • Profile Image

    Answered by unicefethiopia on July 03, 2014 at 03:29 PM

    Thanks. it worked well after i cloned your form and checked the conditions.


  • Profile Image

    Answered by Carina on July 03, 2014 at 04:22 PM

    I'm glad to hear it. If you need further support please let us know.

    Thank you.