Skip to main content
Participant
Jun 12, 2018 6:49 PM UTC
Question

Inputting date options

I want to give my customers the option of inputting mm/yyyy OR yyyy OR mm/dd/yyyy on the adobe pdf fillable form when I send it to them but am having trouble making this work.

Does anybody know how to do this?

THANKS!

AW

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Inspiring
Jun 13, 2018 5:53 PM UTC

The provided format options use some behind the scenes scripting for the keystroke (only allowing valid valid characters for the format), validation (the value entered is a valid date), and format (the correct display for the date format is used). Since you have very diverse and very different formats, I think you may only be able to perform the validation and formatting by using some very custom JavaScript.

This seems like a very unusual requirement.

Translate
Inspiring
Jun 13, 2018 5:01 PM UTC

I would suggest the following

1. use a keystroke event to authorize only digits and the "/" character

2.  Test the length property (7, 4 or 10) to determine the format chosen by the user

3.  if the result is 7 or 10, Try to convert the string to a date Object to reject any value that is not a valid date

Translate