Skip to main content
lisal4237300
Participant
June 22, 2017
Question

Date format not getting applied in PDF form?

  • June 22, 2017
  • 1 reply
  • 3178 views

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!!

This topic has been closed for replies.

1 reply

Inspiring
June 22, 2017

Can you post the JavaScript actions you are using for the Custom Keystroke, Custom Format, Validation, Calculation or other action you are entering?

lisal4237300
Participant
June 23, 2017

Hi there, I'm just going into the "Text field properties" dialogue, Format tab. Selecting Date, then Custom, then entering "LIVE: m/d".

Inspiring
June 23, 2017

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.