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.
How can I set the date time tool to display a future date and time?Asked by checkrecheck on April 24, 2015 at 11:29 AM
I have a form that needs to show a future date and time, based upon the selection made (Timeframe). I want this future date or time to be displayed automatically based on selection. Is there a custom script that can achieve this? Many thanks!
You can use the conditional logic to display specific date time field depending on the selection.
1. First, set multiple date field, add custom date and custom time on them.
2. In the conditions wizard, choose the first option.
3. Based from the rule, if an option is selected, show a specific date. In my case, if "Future Date 1" is selected, it will display date field named "Date1".
You can check how the form works here: http://form.jotformpro.com/form/51135381306952
I hope this helps.
thanks for your reply. I think you misunderstood my question. The date that should appear is based on a previous selection. So say a user selects 7 days, the date and time that should be displayed should be exactly 7 days after the date and time of now.
Similarly if 12 hours is selected, the date and time should be of exactly 12 hours after now. Would you please help me? Thanks!
Unfortunately that would not be possible to do at this time in JotForm Builder. You could however grab a full source code of your jotform and then have a developer create this functionality for you and show you how to re-apply the code on it.
If you make any changes in the Form Builder however, you would need to re-embed the form to see them and to re-apply the same functionality to your form so that the days and time is correctly applied and shown in the other field.
What you could do within the Form Builder is to create a calculation that would show the dates (not the time as well) and then show a message "within 12 hours" if that is their selection.
For example please take a look here: http://form.jotformpro.com/form/51136095032951
Do let us know if that would work for you.
Thanks for your reply! Your solution is actually quite close to what I would like. The dates are of course correct. I would like to know how come the same is not possible to do with the time?
Thanks once again!
Ben used conditions and calculation to create that form. Please check the screenshots below.
I would like to know how I can do the same so that the TIME is also included. Thank you.
We don't have a method or a function for the "time", only for the "date" which is why it will not work with the calculation field.
Hope this answered your question. Thank you.