Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Autopopulate Buisness days
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Autopopulate Buisness days

 Post Reply Post Reply
Author
48kilos View Drop Down
New Member
New Member
Avatar

Joined: 20 Jul 2015
Points: 1
Post Options Post Options   Quote 48kilos Quote  Post ReplyReply Direct Link To This Post Topic: Autopopulate Buisness days
    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.

 

 

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

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)

 

Back to Top
Sponsored Links


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

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

This page was generated in 0.063 seconds.