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 to make departure date always after arrival date?

    Asked by huizenijmegen on January 17, 2016 at 07:42 AM

    how to prevent wrong dates

    dates wrong dates prevent
  • Profile Image
    JotForm Support

    Answered by Mike_G on January 17, 2016 at 05:18 PM

    On your form, http://www.jotform.com/60044241786352, I'm seeing Departure Date and Arrival Date fields. When you say wrong dates, are you referring to the dates from the past and you don't want your submitters to accidentally select dates from the past, correct?

    I have checked your form and it seems that you have already made the fields not able to accept past dates.

    If this is not what you are referring to, kindly give us more details about your concern so we can further help you. We will wait for your response. Thank you.

  • Profile Image

    Answered by huizenijmegen on January 17, 2016 at 06:47 PM
    Hi,
    I’ve 2 issues with the dates.
    Since the dates are referring to the beginning and ending of a stay in our B&B
    there are 2 separate demands:
    (1) both dates must be in the future
    and
    (2) the end-date must be AFTER the start-date.
    Now, I know that the first issue is an option that can be ‘checked’ within both fields.
    However, I’ve not figured out how I can make the end-date always later than the start-date.
    I guess I’ve to create separate calculation fields that contain the difference between these two dates as an integer.
    Would that be the way to handle this, or is there another way?
    best,
    Carolus
    B&B Huize Nijmegen,
    The Netherlands
    ...
  • Profile Image
    JotForm Support

    Answered by BJoanna on January 18, 2016 at 05:11 AM

    Thank you for providing us additional information.

    It is not possible to prevent users to choose End date that is before Start date.

    Possible workaround is to add  Form calculation field that will calculate difference between dates and then if calculation is less that 0, you can use conditional logic to hide submit button so your users will not be able to submit your form if End date is before Start date. You can also add text field that will notify your users that End date can not be before Start date.

    Instead of hiding submit button field, you can also use Enable/Require field condition and disable submit button. 

    Here is my demo form: https://form.jotform.com/60172652512953 

    Feel free to clone it.

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

  • Profile Image

    Answered by huizenijmegen on January 18, 2016 at 05:47 AM
    Thank you so much.
    This is exactly what I would like to achieve.
    I’ll try this and implement it in my form
    Regards,
    Lydia Grütters
    B&B Huize Nijmegen
    www.huizenijmegen.nl
    Groesbeekseweg 50
    6524DE Nijmegen
    The Netherlands
    ...
  • Profile Image

    Answered by Carina on January 18, 2016 at 09:33 AM

    On behalf of my colleague you are most welcome.

    Let us know if you need additional support.

  • Profile Image

    Answered by huizenijmegen on January 18, 2016 at 04:47 PM
    Just a remark after implementing your solution using a calculation field.
    Pffff, … I found it.
    The addition of a calculation field is … very well hidden.
    It took me some time to:
    * discover that this is not a regular field but a widget (strange name BTW)
    * which is - by default - NOT shown under the list of widgets
    * and only shown if you “search" for it
    * then it pops out of thin air ...
    and i was confused about
    * the meaning of some “advanced options” of the calculation wizard:
    such as: “wait for input before including the field in calculation”
    This latter option, I presume, is to prevent calculations before the variables are filled.
    OK
    But what then is the value of such a calculation field if not all fields are filled?
    Zero? or is it the pre-populated value? And if so, what happens if this is, say 999?
    Since the contents of a warning are shown if the dates are ‘wrong’, i.e. the departure date
    is BEFORE the arrival date, I’ve difficulties with defining the proper default value of this calculation field.
    Best,
    Carolus
    ...
  • Profile Image
    JotForm Support

    Answered by BDAVID on January 18, 2016 at 09:58 PM

    I don't understand your concern, the forms calculation is working as expected. The fact that the Form Calculation field has a default value does not affect your form's conditional logic.

    If you want to remove a default value, simply click on the gear icon, click on "edit properties", look for "Default Result" and leave it empty:

  • Profile Image

    Answered by huizenijmegen on January 25, 2016 at 12:45 PM
    Hi,
    another question regarding my form.
    I’ve implemented your suggestion on the dates: excellent.
    It works.
    However, the error message does not look the same as the standard error messages.
    The standard error messages are in red.
    How can I realize that my own error message look the same.
    best,
    Carolus

    ...
  • Profile Image
    JotForm Support

    Answered by BJoanna on January 25, 2016 at 01:58 PM

    Considering that your last question is not related to subject of this thread, I have moved it to separate thread and we will provide you an answer there shortly.

    http://www.jotform.com/answers/755353