Preventing form submission if the end date is before the start date

  • pvhwoo
    Asked on June 25, 2024 at 5:14 AM

    Hi,

    I have two date picker widgets startdate and enddate.

    Is there a way to prevent form submission so long the enddate's date is a date that is before the startdate's date?

    Thanks very much!


  • Mahmoud JotForm Support
    Replied on June 25, 2024 at 5:24 AM

    Hi Philip, 

    Thanks for reaching out to Jotform Support. Sure, you can use our form Conditional Logics to hide the submit button if the end date's date is before the start date's date. Let me show you how:

    1. In Form Builder, in the orange navigation bar at the top of the page, click on Settings.
    2. Click on Conditions on the left of the page.
    3. Now, click on Add a New Condition and then click on Show/Hide Field.
    4. Set the conditions as you see below:

    Preventing form submission if the end date is before the start date Image 1 Screenshot 30

    Check out the steps and the result in the below screenshot:

    Preventing form submission if the end date is before the start date Image 2 Screenshot 41

    Give it a try and let us know if you are looking for something else.

  • pvhwoo
    Replied on June 25, 2024 at 10:46 PM

    Hi Mahmoud,

    Great! Thanks so much for the help.

    On more request: Any idea on how to show a persistent error message just below the date picker in highlighted bold red with no border? I tried a error text below it but it showed a border and user may be missing it as it appears an input field.

    Thanks!

  • Jessica JotForm Support
    Replied on June 25, 2024 at 10:54 PM

    Hi Philip,

    We’ll need a bit of time to look into this possibility. We'll get back to you as soon as we can.

    We appreciate your patience and understanding in this.

  • Jessica JotForm Support
    Replied on June 26, 2024 at 1:49 AM

    Hi Philip,

    To avoid confusion with the first question in this thread, we'll help your second question in a separate thread. Please refer to this thread, we'll help you there.

    We appreciate your patience and understanding in this.

 
Your Answer