Copy link to clipboard
Copied
Hi,
I'm trying to add a custom date input field to a pdf. I've started by creating a text field, and specified my desired font, alignment, and date format (a custom format, "LIVE: m/d"). When I preview it in acrobat, the formatting gets auto-applied. In other words, if I type in, "June 22", it automatically switches to "LIVE: 6/22" as intended.
However, when I save the PDF and open it again, the date format is lost; it essentially becomes a free-text field. Everything else (font color/style and alignment) is preserved. Am I missing something?
Thank you!!
Copy link to clipboard
Copied
Can you post the JavaScript actions you are using for the Custom Keystroke, Custom Format, Validation, Calculation or other action you are entering?
Copy link to clipboard
Copied
Hi there, I'm just going into the "Text field properties" dialogue, Format tab. Selecting Date, then Custom, then entering "LIVE: m/d".
Copy link to clipboard
Copied
If I type in June 14, 2017 it seems to work even after saving, closing the form and closing Acrobat DC.
Date format get tricky when the month day and year are not included in the entry. There are 25, 26, or 100 occurrences for a any date with a century. The custom format only affects the displayed value but the underlying date string is still validated as a valid JavaScript date. So one probably should not enter the displayed value but a valid date including the month day and 4 digit year.
Copy link to clipboard
Copied
Thank you for your help. I'm having trouble understanding what you mean.. can you explain in layman's terms? 😉
To be clear, the formatting does get applied after I define a format that uses month and day. I close out "Text field properties", and preview the functionality, and everything works great--there's even a date picker next to the field. However, after I close Acrobat, and open the PDF, the field literally becomes a free text field, with no date formatting of any kind. And the date picker is gone too.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more