Skip to main content
Participant
September 20, 2024
Question

A date of birth of 31 automatically changes to 01 on a website.

  • September 20, 2024
  • 3 replies
  • 262 views

I work for a state agency and we have a PDF that has many lines where a DOB is required. The day of birth fields are customized to 'dd' so that would include any date from 1-31. This is fine and works on the PDF version, but once the form is transferred to a website, whenever someone tries to put in a day of birth as '31' it is atuomatically changed to '01'. How can I resolve this? Thank you. 

This topic has been closed for replies.

3 replies

try67
Community Expert
Community Expert
September 20, 2024

What PDF viewer is used to display the file when viewed in the browser? The fault is most likely with that viewer, as most PDF plugins that come with the browsers are sub-par when it comes to things like scripts and form fields.

Thom Parker
Community Expert
Community Expert
September 20, 2024

Formatting scripts, or scripts of any kind on a PDF, do not operate properly when the PDF is viewed in a web browser. 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
PDF Automation Station
Community Expert
Community Expert
September 20, 2024

It seems that when you format a custom date of dd the web browser is validating the day for the current month.  Since September only has 30 days it is rejecting it.  You can format the field to a 2-digit number with no decimal places instead, and in the validation tab, set the range between 1 and 31.  Not all web browsers and PDF viewers are consistent but this worked in the web browser for which I tested it.