Previous | Next | (P-PDF) JavaScript
Topic: Timesheet w/ auto dates
Conf: (P-PDF) JavaScript, Msg: 28632
From: evilfrogmonster
Date: 10/17/2001 05:57 AM
I have a timesheet in .PDF format, and there is a field where you can enter the "Period start date". I want to enter the start date, and have the rest of the dates automatically computed. So for example:
Period Start Date: 10/21/01 .. and then the rest of the fields like Sun: 10/21/01, Mon: 10/22/01.. etc etc.
So, the problem is with referencing the cells together.
If I hardwire a date, I can compute the next date easily. But, when I try to reference the date located in the "end date" field, I get an error.
Here is my code:
//Author Kristine Theobald
var a = this.getField("7");
var b = new Date(a); //Date takes a string argument
var c = new Date(b.getYear(),b.getMonth(),b.getDate() + 1);
var d = this.getField("8");
c.value = util.printd("mm/dd/yy", c);
//end
if i type in var a = "12/25/01"; the whole thing works, and it calculates the next date. I have tried numerous things in the start date field as well. I have tried getting the value and converting it to a string. I am just wondering if there is anything I've missed?
Kristine Theobald
Boise State University