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:
- Input "May 25, 2017" into Date Field
- Validation code converts this to "2017 05 25"
- Acrobat formatting applies (expects: "yyyy mm dd"), enabling the date picker
- Acrobat Date Picker is available for more rapid input changes
Current Problem:
- Input "May 25, 2017" into Date Field
- Acrobat formatting applies (expects: "yyyy mm dd"), rejects inputs
- Validation code has nothing to work with
- Acrobat Date Picker is available for more rapid input changes
Current non-ideal solution:
- Input "May 25, 2017" into Date Field
- Validation code converts this to "2017 05 25"
- Acrobat formatting disabled
- No Acrobat Date Picker
I see three possible solutions, but don't know enough on how to (or if I can) achieve them.
- Preempt Adobe's built in formatting script somehow. I've tried calling event.change and event.willCommit, but I clearly don't understand them enough to use them properly. Additionally, I thought script precedence was Keystroke > Validation > Format > Calculation, but it appears either I'm wrong or Adobe's built in formats are special.
- Force enable the date picker somehow. I don't have high hopes for this. I don't get why Adobe didn't make the damn thing a check box option.
- Set the Format option to a wildcard somehow. Like the last three, I don't know if this is possible, but this seems the most likely to work. Basically, let the format accept anything.