In short: I want to use Acrobat DC's built-in date picker on a text field without using Acrobat's Format option.
In full:
I'm trying to enable the date fields in my form to accept a large variety of date formats as input, including a date picker. I've written validation code to accomplish this, however Acrobat is rejecting inputs before the validation code triggers and rewrites the date into an acceptable format. This means that I have to set the field's format to "None" in order for my validation code to fire properly, losing the built-in date picker in the process. While this doesn't make the form not work, it hampers UX, which is something I've been working to strongly improve in this form.
To illustrate the issues:
Ideal/Goal:
Current Problem:
Current non-ideal solution:
I see three possible solutions, but don't know enough on how to (or if I can) achieve them.
You'll need to use two fields. The first one is the main field and uses a custom format script to format your date, not one of the predefined ones. Right beside it is a field formatted for a date that's just wide enough to give you the picker, set it's text color to white so that none of the characters in the value actually show. Use the OnBlur action to update the first field when the user exits the second. If you put them right up against each other, to the end user, they'll appear to be the same field.
In addition to @joelgeraci 's answer, you might also consider a non-Adobe date picker (which requires the very newest versions of Acrobat/Reader anyways). There are a few out there, some better some a bit less…
Shameless plug: yours truly happens to have created the most elaborate and configurable date picker for PDF forms; for more information and quotes, feel free to contact me in private.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.