Acrobat JavaScript Date picker for custom dialogue
Copy link to clipboard
Copied
Is there a JavaScript for a date picker for a custom dialogue which is used to create an acrobat dynamic stamp? The custom dialogue has several text fields and radio buttons on it, and the user has to type in a date (not the current date). If it is possible, I would like the user to select a date from a date picker, but I don't know if this can be done.
Copy link to clipboard
Copied
No, nothing like this already exists.
You can always validate the date and force the user to enter a valid one before leaving the dialog.
Or use dropdowns for setting the day/month/year.
Or create a custom date picking popup dilaog.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Thanks Thom.
What did you meant about "creating a custom date picking popup dialog" and how to acheive it?
Copy link to clipboard
Copied
You'll find a "pop-up" calendar here that you can copy and paste onto your PDF. Read the instructions carefully.
https://www.pdfscripting.com/public/Free-Sample-PDF-Files-with-scripts.cfm
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Thanks for your contribution, very useful. I had looked at your implementation but it is not so clear for me how to port that one on custom dialogs since there is no hidden property as it is for regular form fields in Acrobat. I guess it should be tricky to acheive it. so I hope I could port it later.
Copy link to clipboard
Copied
I wasn't very clear. I presented to separate solutions. The first was to create a simple custom dialog for picking the date. Not a calendar popup. A calendar popup is a complex and and advanced programming task in any programming language. Fortunately, someone has already done this for Acrobat using form fields and JavaScript, which was the second solution I suggested, that you can download at the link. The PDF file provides instructions for porting over the calendar fields and scripts to your own PDF.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied

