Skip to main content
Participant
July 17, 2020
Question

How to change the format of Form Field

  • July 17, 2020
  • 2 replies
  • 514 views

I created some text form fields.

Is there a way to change the format of Form Field  to Date format with Javascript?

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
July 18, 2020

Doing so requires using a couple of undocumented methods, namely AFDate_FormatEx and AFDate_KeystrokeEx. Try searching the forums for them (or just google it in general) and hopefully you'll find some more documentation.


If you're interested, I've developed a (paid-for) tool that allows you to do it quickly and easily, without having to write any code. You can find it here: http://try67.blogspot.com/2012/06/acrobat-apply-format-to-multiple-fields.html

ls_rbls
Community Expert
Community Expert
July 18, 2020

Is there a particular reason why it has to be with JavaScript instead of using the built-in custom format options?

 

Are you just trying to grab the date from an actual date field and display that date as a text string  in another text field object?

macejdAuthor
Participant
July 18, 2020

I have a Word document as a source file, this is converted to PDF and based on some conditions I create Form Fields in this PDF with addField method. So I would like to create a form field with date picker. According to my understanding it is a text field with format set to Date. I would like to do it in the same way as I can set e.g., Font type for Form Field with its textFont property.

I do not want to grab any value or copy it. Thanks