-
mcloudsphereAsked on September 10, 2024 at 2:01 PM
Hi,
I’m currently using two 'Date Pickers' in my form: one for the 'Start Date' and another for the 'End Date'. I would like to set a condition ensuring that the 'End Date' is at least equal to or later than the 'Start Date'. Additionally, I would appreciate guidance on how to display an error message when an 'End Date' earlier than the 'Start Date' is selected.
Thank you very much for your help!
-
Angelica JotForm SupportReplied on September 10, 2024 at 2:43 PM
Hi mcloudsphere,
Thanks for reaching out to Jotform Support. I’ll need a bit of time to look into this. I’ll get back to you as soon as I can.
Thanks for your patience, we appreciate it.
-
Angelica JotForm SupportReplied on September 11, 2024 at 2:21 PM
Hi mcloudsphere,
Setting a condition to ensure that the End Date is at least equal to or later than the Start Date is easy. Let me walk you through it, step by step:
1. First, add a Form Calculation widget to the form:
a. In Form Builder, click the Add Form Element +.
b. Go to Widgets tab.
c. Add/drag the Form Calculation widget.
d. Then, right click the widget and select Hide.
2. Set the Form Calculation widget to determine the difference between the Start and End dates like you see below:
3. Add a paragraph field that conveys a message that End Date cannot be Earlier than the Start Date:
a. In Form Builder, click the Add Form Element +.
b. Under Basic tab, scroll down then add/drag Paragraph field.
c. Click the Pencil icon to edit the text and Save.
d. Then, right click the field and select Hide.
4. Now, let's set up the conditions:
a. In Form Builder, in the orange navigation bar at the top of the screen, click on Settings.
b. Click on Conditions on the left side of the screen.
c. Now, click on Add a New Condition and then click on Show/Hide field.
d. Set the conditions like you see below:
Here's the result and my demo form for your reference:
Give it a try and let us know if you need any help.
-
mcloudsphereReplied on September 18, 2024 at 9:41 PM
Thank you very much! I really appreciate your detailed response and the demo form.