Copy link to clipboard
Copied
I can format a form field for specific types of data.
Example 1. SSN, since everyone's SSN is 9 digits, when you type in the field 123456789, if I Custom format the field as SSN, Acrobat automatically knows where to place the dashes 123-45-6789.
Example 2. Phone #, since the typical telephone number in the US is 10 digits, when you type 8005555555. if I Custom format the field for telephone #, Acrobat automatically knows where to place the ()'s, space and dash. (800) 555-5555.
My question is with the date:
Example 3. Date, If I simply enter 1232023, Acrobat would not know if I meant 1/23/2023 or 12/3/2023. But if I Custom format a Date field as MM/DD/YYYY, why won't it accept 01232023 and place the /'s after the 2nd number and the 4th number?
I guess, what I'm trying to ask is, is there a way to enter a date without having to enter either -'s or /'s ?
Copy link to clipboard
Copied
For 8 numbers 01232023 you can use this:
var str = event.value;
str = util.printx("99/99/9999", str);
if(event.value)
event.value = str;
Copy link to clipboard
Copied
As always, thanks Nesa.
Yes, that works, but now is seems like you can't enter 5/5/2023.
Is there a way for the date field to accept both 5/5/2023 and 05052023?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more