PDF Popup Calendar Demand Drives Creative Solution
While there was high demand for popup calendars in PDF fillable forms, Adobe software didn’t have a tool for adding them. Like many functions that are only limited
by your imagination, it was possible to create one using JavaScript.
A company call FormRouter had a free plugin for adding calendars to PDF forms, but it worked by adding hidden fields for every day of the month near the date field. These fields were made visible when the calendar was activated. The problem with this technique was the fields took up a lot of real estate on the form and made it difficult for the form designer when placing fields on the rest of the form.
Some other independent developers had calendar tools for sale that used popup dialog windows for the calendars instead of hidden fields. This was a better technique that used dialog buttons for the days of the week in the calendar. The issue was the days of the week buttons. They were wide thin rectangles instead of squares and the main dialog window was large and unappealing.
Take the Acrobat Pro/JavaScript eLearning Course Acrobat Like a Pro
When I decided to try my hand at creating a popup calendar using a dialog window I soon discovered that the buttons on the dialog had a minimum width, no matter how wide you set them in the script. In order to have square buttons instead of rectangles you would have to match the height of the buttons with the minimum width. This led to oversized squares, which meant a huge window for the popup calendar. Not good.
I soon discovered that popup dialog images could trigger actions in the same way buttons could. This not only meant that I could use any image I wanted for the date numbers, but I could also make them any size I wanted. I used color in the date numbers inside squares with a 3D effect so the images looked like buttons. The result was a reasonably sized popup calendar.
In the image above, the date numbers are images and the scroll arrows are buttons. Those buttons are set to the smallest width possible so you can see why they would not be suitable for the date numbers.
FLEXIBLE OPTIONS
As soon as the calendar tool went up for sale I was fielding requests from Europe for an option to start the week on Monday, instead of Sunday like the North American version. I made some adjustments so the user could select Sunday or Monday for the first day of the week and I built in several options for the date format, as well as an English/French language option.
Any date format could be used by tweaking the script in the mouse-up action of the popup calendar button.
**Shameless Plug**
www.pdfautomationstation.com sells the popup calendar/date picker tool described above. Use the promo code Substack_Calendar at checkout before Jan 1, 2024 and receive a 50% discount.
ADOBE FINALLY ADDS THE FEATURE
Adobe finally added a popup calendar feature that was automatically added to fields that were formatted as date fields. I thought my popup calendar tool sales would come to end, but I still made a few here and there. I think the reasons are as follows:
Adobe’s version does not work on older versions of Acrobat and Reader.
Adobe’s version is not very intuitive for scrolling years.
DYNAMIC STAMP POPUP CALENDARS
Once most people have up-to-date versions of Adobe and will eventually get used to the calendars, I imagine my calendar tool will be obsolete for form designers. I will still use it myself however.
We often get requests to add popup calendars to dynamic stamps because of different dates on the stamp (received, paid, due, etc.) and the date is not always the current date the stamp is being applied. A popup calendar is easier than typing the date in a field for the end user.
When making requests, a lot of people think that fields can be formatted in dynamic stamps the same way they can be formatted in fillable forms. Because the user-entered fields in a dynamic stamp are contained in popup dialog windows and because there is no popup calendar option in dialog windows, you can’t have one in a dynamic stamp without creating your own.
I create dynamic stamps with popup calendars by programming the dialog window to trigger the popup calendar I developed – a dialog window on top of a dialog window – so to speak.
I’ve encountered similar dynamic stamp challenges when I received requests for digital signatures triggered by stamp users. Solutions often require outside-the-box thinking. I attribute a lot of my success in this regard to my lack of formal training. A lot of developers give up as soon as they believe there is no solution in the “documentation” (i.e. the Acrobat JavaScript Reference Guide). Sometimes the path from point A to point B takes a long detour through unmapped territory.
This is the third article that tells my story, and doesn't contain any how-to nuts and bolts. It will be the last in the story telling theme – for now. I thank you again for your patience and I look forward to sharing many more articles with you. You can check out some previews here:
See you soon…