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.
Is it possible to hide/unhide fields based on the current date?Asked by templesinai on July 15, 2016 at 01:08 PM
I would like to create a ticket sales form that will disable or enable certain elements on or after a specific date. For example, I may allow payment by check as a valid payment option, but after a certain date I would like to disallow that option automatically while still offering the other payment methods I've set up. The form would check for "today's date" and compare that to a key date parameter that I set and present form options accordingly by hiding or unhiding fields to fit my scenario.
Is this possible? Currently, I get the same results by manually altering the form after the key dates happen. I would like this to happen automatically if it can be done. Thanks!
Nevermind. I think I figured it out. Create a HIDDEN field called TODAY and populate it with today's date and time automatically. Then, write various hide/unhide conditions based on this hidden field. Seems straightforward.
Are there any issues and/or limitations I should be aware of when trying this? Thanks!
Yes, you are correct. You can achieve the required functionality of show/hide a field according to the Conditional logic
If you face any issue, or need further assistance, please revert back.
I DID just run into this issue, though on this same topic. How do you incorporate TIME into the date condition too. I've tried several syntax formats and can't make it recognize TIME on the test form. See the attached image here. I'm trying to make the form change what is displayed not only after a certain date (that's easy) but also after a certain TIME on that day.
Unfortunately, the time part of the date/time field is not supported at the moment. You can only make conditions with the date part.
However, I would suggest you to take a look at the following thread where my colleague has described the workaround he uses so he can use the date and time in conditions.
He created a separate time field that takes the current time and then he uses the conditions separately for the date part and for the time part.
Let us know if you need more information.
Actually, another of your colleagues suggested an additional work around that I think will work better for my situation. It can be found at this link http://www.jotform.com/answers/883789-How-do-you-incorporate-TIME-into-the-date-condition and seems to be a pretty nice solution. Thanks for your help anyway. Have a great week!
On behalf of my colleagues, you are welcome! Contact us anytime, we will be glad to assist you.