- trafficstopAsked on January 03, 2014 at 02:22 PM
I have a form that needs to show a deadline, rather than have our reps select the date manually on the form I'd rather the date just be displayed automatically. The deadline would always be 2 days from the date the form is submitted. Is this possible?
It doesn't necessarily need to utilize the date time tool either, it can be static text that cannot be changed by the rep.
- JotForm SupportEltonCrisAnswered on January 03, 2014 at 03:53 PM
Unfortunately, that's not possible with the calendar tool in the form builder. However, this is doable when you take your form source code and fo further customization. You can inject custom script on your form source code that adds +2 days on the current day and even make the calendar field not clickable so it can't be edited.
I will provide you the script with example later today. Stay tuned!
- trafficstopAnswered on January 06, 2014 at 11:34 AM
Any update on the script?
- JotForm SupportEltonCrisAnswered on January 06, 2014 at 12:16 PM
I am truly sorry, I wasn't around for 2 days. I will make sure it'll be available today.
- JotForm SupportEltonCrisAnswered on January 06, 2014 at 12:24 PM
By the way, can you please confirm if this is the form you're going to apply the script? http://www.jotform.co/form/33536356017857. Take note that the script works specifically on this form (if this is the correct one).
We'll await your reply. Thanks!
- trafficstopAnswered on January 06, 2014 at 12:26 PM
Not a problem, & yes that is the form I will need the script for, thank you!
- JotForm SupportEltonCrisAnswered on January 06, 2014 at 10:56 PM
Here's the script. http://pastiebin.com/52cb789927553
Please take your form source code and paste that script under it. After that, you can embed the joined script all together on your page, or you can save it as html file and upload it on your server.
Sample result: (I have added comments on the script so you can easily identify where to add number of days)
Let us know if you need further assistance.
- ceu.csupomonaAnswered on June 04, 2014 at 01:43 PM
- veritascreditAnswered on October 21, 2014 at 09:56 PM
The new thread link is not working. would it be possible to have these instructions from the above functionality of a future date be posted again.
- JotForm Supportashwin_dAnswered on October 22, 2014 at 08:18 AM
The thread you are trying to access is actually a private thread and that is the reason why you are unable to open it.
If you check the message by my colleague above on this thread only, the complete information is already provide with the custom script code. It would require few changes but it will work for your form too.
Do check and get back to us if you have any questions.
- veritascreditAnswered on October 22, 2014 at 12:43 PM
I've taken my test form with date and added the source code to my webpage in addition to the source code I have also added custom code after the for source code.
In the custom code I've changed the "getelementbyid" to my form id's for the day month and year. Where the "daystoadd" command is I have typed in 365 as I want the calendar to show an expiration date of 1 year.
I have published the form online, but there is no change in the date. Can someone share with me where I went wrong?
here is my test published test calendar
- JotForm SupportMike_TAnswered on October 22, 2014 at 03:45 PM
Elton's solution requires disabled default time. Please disable a Default Time option on your DateTime field, then get the fresh form source code and use it on your page.
- veritascreditAnswered on October 22, 2014 at 05:00 PM
I did as you instructed, but the only change is that the date fields are now empty.
I also cleared the browser cache.
any other thoughts?
- JotForm SupportMike_TAnswered on October 22, 2014 at 06:14 PM
Do you use a fresh form source on your web page?
I have cloned your form, added the form source code and script from your page, and it worked well: