Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Fillable PDF that populates a future buisness day

$
0
0

I have created a fillable PDF document that end users will utilize to book an event. The end user will enter the date they want the event to happen.   Further down the document i would like several read only fields to auto-populate with business dates along the way that show the end user some benchmarks of when things will happen.

 

 

Example:

End user enters an event date into TextBox1

Textbox2 auto-populates with a date X Business days before the event showing when the End User will receive a communication confirming that the event is still scheduled

TextBox3 will Auto-populate with a date Y business days before the event showing end user when the set-up for the event will begin

Finally TexBox4 with auto-populate with a date Z business days before the event showing when the end user may inspect the event site

 

 

 

I am able to have all the text boxes auto-populate with Calendar days using the below code.  However I want to be able to execute this doc using Business days not calendar days.    Is this possible?

 

 

 

 

 

For the calendar days I have a Document script called "countDays"

function countDays(z){

var a = (1000*60*60*24) * z;

var b = 0;

var c = new Date();

var d = this.getField("TextBox1").value;

if(d!=""){

var e = Date.parse(util.scand("mm/dd/yy", d));

c.setTime(e + a);

event.value = util.printd("mm/dd/yy",c);}

}

 

TextBox2 then has a Custom Calculate script of

countDays(-14)

 

TextBox3 then has a Custom Calculate script of

countDays(-7)

 

TextBox4 then has a Custom Calculate script of

countDays(-2)


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>