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

Default text until date entered

Explorer ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

There used to be a list of simple commonly used lines of code for various actions.  I can't find that list.  Does anyone know where that is?

I have a multi-page pdf.  On the first page, I have a list of important dates.  These dates are based on dates entered elsewhere in the document.  I want to enter default statements in the date fields on page one, for example "Enter Delivery Date on pg 2".  Once they enter the date on page 2, I want that entered date to populate the field on page 1. How do I do all of this?

Message was edited by: Teresa Kassen

TOPICS
Acrobat SDK and JavaScript , Windows

Views

481

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 ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

So first, fields with the same names have the same value, so just make the fields you want copied have the same name

For the other bit, unfortunately you have a conundrum. The correct way to display instructional text in a field is with the format event. This event provides an opportunity to change the display of the field without changing the value.  But since you've already selected the Date formatting, this option is not available.

There is no way around this if you want to keep the calendar popup.

But if you don't mind loosing it, There is a way around this, but it's tricky.  First, you have to set the Custom formatting to override the display on an empty field

// Custom Format Script

if(event.value == "") event.value = "This is my message";

Make sure this works first, Then to get the automatic data popup, you have to enter the built-in JavaScript date function into the custom Keystroke script, with the correct formatting options. Once you do this the Format Tab on Field Properties will revert to Date Formatting.

// Custom Keystroke Script

AFDate_KeystrokeEx("mm/dd/yy");

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
Explorer ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

Thank you Thom.  That is well beyond my capability.  I found an alternative, more cluggy way of accomplishing what I need.  It is not elegant, but it works.

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 ,
Dec 09, 2017 Dec 09, 2017

Copy link to clipboard

Copied

What is it?

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
Explorer ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

LATEST

I left it blank and put in the permanent text field header the need to enter information on another page. 

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