These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Date Validation within a PDF form

spswell
Registered: Aug 1 2011
Posts: 18
Answered

I apologize in advance for the lengthy post....I have a form that requires, among other things, a date in the following format: mm/dd/yyyy.
 
After a lot of experimentation I have been able to validate and put default dashes in for the date (_ _ / _ _/_ _ _ _) in the form field, but Acrobat will not allow me to do both at the same time. I'm not sure if I'm doing something wrong or if it is actually not possible to have both features work simultaneously.
 
If you have any other interchangeable solutions, please feel free to share. Ideally, what I want my form to do is one of two possible things:
 
1) Before someone clicks in the form field, they will be able to see "mm/dd/yyyy" and after they click on the field, they will be able to type in their own date without having to delete the variables that are temporarily representing the date. In the past I have made "mm/dd/yyyy" my default text, but I believe it makes it more time consuming to have to backspace over all of the variables and it also runs the risk of the person entering information deleting the dashes and entering the date in their format. I have also put / / separated by spaces in order imply the correct format but I was wondering if there was a simpler way of doing things.
 
OR
 
2) As someone begins typing in the date field the dashes ( / / ) automatically appear in the field when the mm/dd/yyyy format is being entered.
 
Since I am a relatively new user, a lot of things get lost in translation if I simply read them off of the forum. Perhaps if anyone is willing to help, they could also attach an example document that I view in addition to the forum answer. That way, I could go into the Acrobat document to see what your field properties are set as and apply them in my own document.
 
Again, I don't know if either of these (or an equivalent option) are possible, but if they are, I would really appreciate the help.

My Product Information:
Acrobat Pro 10.0, Macintosh
spswell
Registered: Aug 1 2011
Posts: 18
I am also looking to do a similar thing with price ($____.__), which is not one of the automatic format choices available.
KellyMcC
Acrobat 9ExpertTeam
Registered: Jul 11 2011
Posts: 389
Accepted Answer
When you create the date field, under Properties > Format you can simply select Date and choose how you would like it to appear. It will re-format whatever they type in to appear the way you choose.

Kelly McCathran
Adobe Community Expert
Certified Technical Trainer+

spswell
Registered: Aug 1 2011
Posts: 18
I already had already set my specific format that I chose under Properties, but the most it does when I try to enter incorrect data in the field as a test is to have a popup window indicating mm/dd/yyyy format. When you say it will re-format whatever they type, do you mean that it will reformat automatically in the field or that a pop up window will appear?
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Only within in a limited number of entered data. The format of the entered date must be one of the formats with the individual part of the date matching the requirements of the selected format, must have the proper separators, and the interpreted date must be a valid date.

With a format of "mm/dd/yyyy" One for January 31, 2011 one can enter:

1/31/2011
01/31/2001
01.31.2011
01-31-2011
Jan 31, 2011
January 31, 2011

But one can not enter:

01/31/11 - year does not have 4 digits, so Acrobat does not know the century.
31/01/2011 - no month value of 31.

It is possible for your to write your own keystrokes,formats and validation scripts, but this can get quite complex when you get to validating the entered date.



George Kaiser

spswell
Registered: Aug 1 2011
Posts: 18
Thank you for the clarification.

If I chose to go the route of custom keystrokes, formats, and validation scripts, would there be a particular place, file, or website that might be helpful in doing so?
KellyMcC
Acrobat 9ExpertTeam
Registered: Jul 11 2011
Posts: 389
PDFScripting.com is an excellent resource. Check out this page:
http://www.pdfscripting.com/public/department44.cfm

Kelly McCathran
Adobe Community Expert
Certified Technical Trainer+

spswell
Registered: Aug 1 2011
Posts: 18
Thank you! I'll definitely check that site out.