Skip to main content
Participant
June 12, 2018
質問

Inputting date options

  • June 12, 2018
  • 返信数 2.
  • 587 ビュー

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

このトピックへの返信は締め切られました。

返信数 2

Inspiring
June 13, 2018

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.

Inspiring
June 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