Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Inputting date options

New Here ,
Jun 12, 2018 Jun 12, 2018

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

TOPICS
Acrobat SDK and JavaScript
521
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 13, 2018 Jun 13, 2018

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 13, 2018 Jun 13, 2018
LATEST

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines