-
ManasotaAsked on April 26, 2024 at 8:54 AM
How do I calculate the year of today's date and show it on a form?
-
Manilene JotForm SupportReplied on April 26, 2024 at 9:04 AM
Hi Manasota,
Thanks for reaching out to Jotform Support. Apologies, but I'm not entirely clear on your objective. Could you provide more detail about the matter at hand? This will help me grasp the situation more effectively.
Once we have a better idea of what’s going on, we’ll be able to come up with a solution.
-
ManasotaReplied on April 26, 2024 at 9:20 AM
I collect the current date using the date picker widget. I want to include a field on the form that extracts the year from the current date either into the current date field or into another field for display on the form.
-
Chris_L JotForm SupportReplied on April 26, 2024 at 9:38 AM
Hi Manasota,
Thanks for getting back to us. You can do this using the Substring widget. I'll walk you through setting that up:
- In Form Builder, click on the Add Form Element menu on the left side of the page.
- Under the Widgets tab, search for Substring. Drag and drop the widget to your form.
- Now, select the Date Picker and click on the Gear icon.
- Under the Advanced tab, click on Field Details.
- In the text box under Field Ids, copy #year_3.
- Select the Substring and click on the Wand icon. Configure the widget just like what you see in the screenshot below:
- Finally, click on Update Widget. That's it.
Here's a screencast of the expected result:
Reach out again if you need any other help.
-
ManasotaReplied on April 26, 2024 at 10:14 AM
Perfect. Thanks a lot