Print Page | Close Window

Autopopulate Buisness days

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
Printed Date: 17 Jul 2019 at 1:34pm
Software Version: Web Wiz Forums 11.10 -

Topic: Autopopulate Buisness days
Posted By: 48kilos
Subject: Autopopulate Buisness days
Date Posted: 20 Jul 2015 at 11:52pm
I need help with some JavaScript as i am VERY new.

I have created a fill-able PDF document that end users will utilize to book an event. The end user will enter the date they want the event to happen in TextBox1.   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.




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 was 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;


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



TextBox3 then has a Custom Calculate script of 



TextBox4 then has a Custom Calculate script of 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 -
Copyright ©2001-2017 Web Wiz Ltd. -