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.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=2125
Printed Date: 20 Nov 2017 at 12:05am
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


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
fMonth++;
// 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
mailto:bharrington@iconcreditunion.org - bharrington@iconcreditunion.org
 
 



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


Posted By: Merlin
Date Posted: 14 Feb 2017 at 12:24pm
Answered here: http://forums.planetpdf.com/auto-populating-date-field-feb-is-an-issue_topic2131.html


-------------
ENG : https://www.abracadabrapdf.net/utilities-in-english/welcome/ - abracadabraPDF.net
FRA : https://www.abracadabrapdf.net - abracadabraPDF.net



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net