Skip to main content
Known Participant
January 27, 2025
Question

how to fix a JavaScript Warning to disable a date field

  • January 27, 2025
  • 2 replies
  • 2136 views

Hello all, I'm revisiting this error that I can't seem to shake. It's kind of weird that when I turn off the custom formatting in the field I am trying to hide, the function works then I change it back. It works after changing it back. Then somewhere along the way it reverts and give off the error warning: JavaScript Window -

"Invalid date/time: please ensure that the date/time exists. Field [ArrestFile.1.Person.DOA ] should match format yyyy/mm/dd"

It does match this custom date format. I'm scracthing my head at this point. Had this form way too long now. Someone help if possible... much appreciated any help at all.

2 replies

Thom Parker
Community Expert
Community Expert
January 27, 2025

Sounds like badly formatted data is being entered into the field. We really need to look at the form to tell what's going on.

However, you may find this article helpful:

https://www.pdfscripting.com/public/Value-Entered-Does-Not-Match-Format.cfm

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Known Participant
January 28, 2025

thank you however, unfortunately this form is on a classified side so I am unable to send a copy. I also cannot screenshot. The best thing I could do is type any syntax word from word which is a bit much. Is there any other way to mitigate this? I checked out the link & although I essentially understand, it doesn't apply to my situation. I think it's because it's a date field that I am referencing for whatever reason. But it is the correct date format that its supposed to be. 

Thom Parker
Community Expert
Community Expert
January 28, 2025

Make a demo PDF that uses the same same formatting and scripts, then post it.

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
PDF Automation Station
Community Expert
Community Expert
January 27, 2025

Please upload the form.