Two Date fields

  • rbell1
    Asked on September 21, 2018 at 3:15 AM

    Hi

    This form has two date fields.  I need the second date entered to be a minimum of 14 days after the first date that is entered.

    So if we enter 1/10/2018 in the first date field, I need the second "Suspend to..." date field to only except dates later than or equal to 14/10/2018 as per attached screenshot of a wordpress form we are currently using on our website form.

    Thanks

    Jotform Thread 1587285 Screenshot
  • BJoanna
    Replied on September 21, 2018 at 8:02 AM

    You can calculate a difference between entered dates and show a custom warning message and disabled a submit button if the second date is not at least 14 days after the first date. 

    How to Perform Form Calculation Using a Widget

    1537531220calc Screenshot 10

    How to Show or Hide Fields Base on User's Answer

    1537531291cond Screenshot 21

    Here is a demo form - https://form.jotform.com/82633126425958 

    Feel free to test it and clone it

  • rbell1
    Replied on September 21, 2018 at 5:11 PM

    OK that sounds great thank you.

    Is it possible to make the second date field automatically pre-fill a date that is 14 days after the first date they enter.  But they can then change that second date of they would like a longer time?

    Thanks.

  • Richie JotForm Support
    Replied on September 21, 2018 at 5:59 PM

    Yes, you may use calculation condition to add +14 days to the current date.

    Here is an example:

    1.)You choose the first date and set the state to Filled.

    2.)You use the calculate a fields value and add the first date with 14.

    Two Date fields Image 1 Screenshot 30

    3.) You pass the calculation to your second date.

    Sample screen cast:

    Two Date fields Image 2 Screenshot 41

    Sample form:https://form.jotform.com/82635726686975

    Please give it a try and let us know your thoughts.

    Thank you.