Your birth date field script should be for a custom format and not a key stroke. The custom format is used by Acrobat to format currency and percentages but still keeping the value of the field free of the special formatting characters. You might consider using the RegExp for developing the scripts for custom keystrokes and formats. There is an issue with the birth date with a free hand input as mmddyyyy could be confused with ddmmyyyy for some moths and dates. You will also need to validate the dates. It might be easier to enter the month, date and year as individual fields and make a hidden field with full date.
Social Security numbers by definition can not have less nor more then 9 digits, even if it is a TIN issued by the IRS in lieu of the SSN. But if some use a poorly designed form and make the SSN field a number, leading zeros could be lost, but that does not mean that that SSN has less then 9 digits. The SSA may use other claim numbers that have more than 9 digits and could include alphabetical numbers, but these are not SSN's but a claim number.
The util.printd method is for dates and only dates. Have you looked at the util.printf method? It is for other alphanumeric formats.
Thank you for replying Gkaiseril, not really sure what you're talking about with RegExp, hidden Fields and the like. As I stated above, my skills with acrobat are limited and my knowledge of Java script is less than that. Could you give examples or write out examples of what you're talking about? I plan to learn more on Java, scripting and getting better at Acrobat, but for the mean time, I just need the scripting of how to get the Date field to do what I want it to do.
As for the SSN, I'm aware of the 9 digit limit, this is why I'm wanting the script to fill in less-than-9-digit SSN's with leading Zeros. We have had examples of the past of our clients and applicants with Exm 001-34-5678 not entering their 0's first and it confuses them as why their paperwork was'nt accepted or returned invalid. Plus, our OCR system doesn't like the SSN field if its entered incorrectly. This is why I was directed to look at leading 0's and something about a decimal point ...
I haven't looked into the util.printd yet, in fact I know absolutely nothing about it except from what you told me. No idea where to look for the things I want to accomplish.
Access the SSN field as a string and not a number. Acrobat stores the SSN value as a number and not a string but only displays the formatted string. Accessing values as string will show leading zeros but accessing the value as a value will suppress the leading zeros.
You could also use the Arbitrary mask, "999-99-9999", and force the value to a string.