How can I set the date time tool to display a future date and time?

  • Profile Image
    checkrecheck
    Asked 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!

  • Profile Image
    Charlie
    Answered on April 24, 2015 at 01:58 PM

    Hi,

    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.

    Kind regards

  • Profile Image
    checkrecheck
    Answered on April 24, 2015 at 02:06 PM

    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!

  • Profile Image
    Ben
    Answered on April 24, 2015 at 04:10 PM

    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.

  • Profile Image
    checkrecheck
    Answered on April 24, 2015 at 06:43 PM

    Hi Ben,

     

    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?

     

    Have you used javascript or jquery here?

    Thanks once again!

  • Profile Image
    Jan
    Answered on April 24, 2015 at 11:19 PM

    Ben used conditions and calculation to create that form. Please check the screenshots below.

    You can use Javascript or jQuery if you used the form source code.

    Thank you.

     

  • Profile Image
    checkrecheck
    Answered on April 29, 2015 at 08:59 AM

    Hello,

     

    I would like to know how I can do the same so that the TIME is also included. Thank you.

  • Profile Image
    Jan
    Answered on April 29, 2015 at 10:28 AM

    Unfortunately, that is not possible. Ben mentioned that in order to do that, you will need to grab the full source code and hire a developer or you can add some Javascript functionality.

    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.