Print Page | Close Window

Auto populate the month of Feb.

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: General
Forum Description: This is for experienced PDF users. Here you can talk about any topics not set aside for Developers, Prepress and PDF Forms.
Printed Date: 23 Oct 2018 at 11:39pm
Software Version: Web Wiz Forums 11.10 -

Topic: Auto populate the month of Feb.
Posted By: Brianwh
Subject: Auto populate the month of Feb.
Date Posted: 10 Feb 2017 at 9:21pm
Hello All,

I have read a number of posts on several sites. Additionally have noted a number of knowledgeable folks supporting all the of the newb questions. I have visited some resource sites like adobe. and various forums like this one.
However I am still not able to glean the solution for the correct java script that will address correctly auto populating the  Month of February if 1.29 thru 1.31 is selected in the initial date field.
all other dating works correctly
Form has 3 date fields, I am trying to provide script that will allow my users to populate the first field and the 2nd and 3rd field will be dated 1 month later , naturally Feb. is an exception
the main script I have used to this point is
 // get value of field to update - field name is Text5
var sDate = this.getField('Text5').value;
// convert to date time object
// the fields format is mm/dd/yyyy
var oDate = util.scand('mm/dd/yyyy', sDate);
// get the parts of the date
var fFullYear = oDate.getFullYear(); // 4 digit year
var fMonth = oDate.getMonth(); // zero based month
var fDate = oDate.getDate(); // date of month
// increment the month
// create new date time object
var oNewDate = new Date(fFullYear, fMonth, fDate);
// set field value - field has no format
// formatting is applied by the printd method
event.value = util.printd('mm/dd/yyyy', oNewDate);
I have tried a couple others that I could share if needed, however the result of those scripts is the same...I can share the other variations of java scripts used in further posts.
Any assistance in creating the additional scripting needed would be Greatly appreciated.
Ps I have tried tweaking this with formula for adding or subtracting days but alas not doing it correctly.
Again Thank you in advance
Brian -

Posted By: Brianwh
Date Posted: 13 Feb 2017 at 5:59pm
Should I have posted my question in another area ??

Posted By: Merlin
Date Posted: 14 Feb 2017 at 12:24pm
Answered here:

ENG : -
FRA : -

Print Page | Close Window

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