• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to change the format of Form Field

New Here ,
Jul 17, 2020 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

318

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
community guidelines
Community Expert ,
Jul 17, 2020 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?

Votes

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
community guidelines
New Here ,
Jul 18, 2020 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

Votes

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
community guidelines
Community Expert ,
Jul 18, 2020 Jul 18, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines