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

Override Calculated Field Script

New Here ,
Aug 24, 2017 Aug 24, 2017

Copy link to clipboard

Copied

Hello Everyone,

I have two fields on a form that are used as a start and end date for a temporary duty which is normally 10 days.  I have a script that automatically enters a date into the end date field which is 9 days after the start date field.  I would like the user to be able to override and enter a different date if the temporary duty is going to be less than 10 days.    Below is the script I entered into the End Date field:

var date= util.scand("dd mmm yy", this.getField("PTDYStart").value;

date.setDate(date.getDate()+9)

if (this.getField("PTDYStart").value!="")

{

event.value=util.printd("dd mmm yy",date)

}

else

{event.value=""}

I welcome any and all assistance with this.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

257

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
LEGEND ,
Aug 24, 2017 Aug 24, 2017

Copy link to clipboard

Copied

LATEST

Have you considered having a field with the length of the TDY and default that field to 9?

Then the service member could change the number of days for the TDY assignment as needed and you would use the value of the field in the calculation.

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