Override Calculated Field Script

New Here ,
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

87

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

Override Calculated Field Script

New Here ,
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

88

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
Aug 24, 2017 0
Adobe Community Professional ,
Aug 24, 2017

Copy link to clipboard

Copied

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.

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