JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
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.
Require 2 date-time fields to be differentAsked by FWMSH on December 20, 2015 at 05:24 AM
I have two date-time fields on my form, one for a primary date request and another for a secondary / backup date. For most of my submissions though everyone is just making them the same date. I setup conditional logic to increment the date on the backup field if they are the same but I'd really like to just display a message and prevent the form from being submitted. Is there any way to do this?
Scott, please check if this cloned and modified version of your form is what you are looking for:
The way that it is set up is by adding 3 more fields to your form, and several conditions. It looks like two DateTime fields can't be compared directly, so conditional logic can't directly check if the two dates and times have the same value.
For that reason, I have created two Text Box fields, made them hidden by clicking on their gear-shaped icon and selecting Hide Field, and finally created a third Text field that will hold the warning message:
I have then set up conditions for updating field values. I've set it such that value of the first DateTime field gets passed as text to the first Text Box field, and a value of the second DateTime field gets passed as text to the second Text Box field. Please refer to the following image for visual guidance on how to set up the condition:
Finally, I've used a Show/Hide condition that will show the Text field (with our message) and hide the Submit button if the values of the two hidden Text Box fields are the same:
The results of the above described changes is the form I've also linked at the top:
https://form.jotformpro.com/form/53532288846970 (you can clone it into your account for closer examination; note that the cloned form doesn't have any email notifications set, you may need to set email notifications up again on the cloned form)
Please let us know if this resolves the issue you were having, or if you need further assistance, and we will be happy to help.
That just about covers it! I will clone it and tweak a little more after the holiday, thanks!
Thank you for updating us, please do let us know if you hit any snags along the way while setting it up, and we will be happy to help.