How to change the format of Form Field

New Here ,
Jul 17, 2020

Copy link to clipboard

Copied

I created some text form fields.

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

TOPICS
Acrobat SDK and JavaScript

Views

58

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to change the format of Form Field

New Here ,
Jul 17, 2020

Copy link to clipboard

Copied

I created some text form fields.

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

TOPICS
Acrobat SDK and JavaScript

Views

59

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 17, 2020 0
Adobe Community Professional ,
Jul 17, 2020

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 17, 2020 0
New Here ,
Jul 18, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 18, 2020 0
try67 LATEST
Most Valuable Participant ,
Jul 18, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 18, 2020 0