Date and JScript problems

B

Bryan Hughes

Hello,

I am automaticaly trying to set the two date fields in the OnLoad Event, but
I am having problems.

Here is the current code I am using.

function XDocument::OnLoad(eventObj)
{
// Write your code here
var CurrentDate = new Date()
var y = CurrentDate.getFullYear
var DOH = XDoucment.DOM.selectSingleNode("//my:myDOH");
var DOHm = DOH.getMonth
var DOHd = DOH.getDay
// EvalStart = ES
var ESy = y - "1";
var EvalStart = XDocument.DOM.selectSingleNode("//my:myEvalPeriod1");
EvalStart.text = (DOHm + "/" + DOHd + "/" + ESy);
}

When I try and preview the form I get the following error "XDocument is
undefined" .

What is the problem and how can I fix it?

-TFTH
Bryan
 
B

Bryan Hughes

Oh boy how silly do I feel. The easiest things are always the hardest to
see.

-TFTH
 
B

Bryan Hughes

Still cannot process the code.
It now gives the error Object Required; Line 28

Line 28 = varDOHm = DOH.getMonth
why is it doing this?

What I am trying to do is get the Default Value in myDOH field, extract
Month and Day and add Current Year to date then place it in another field
Example:
Current Date = 8/16/2004
DOH = 7/1/2001
EvalDate1 = 7/1/2003
EvalDate2 = 7/1/2004

Place EvalDate1 = Field1(myEval1)
Place EvalDate2 = Field2(myEval2)

What would be the best method to do this?

-TFTH
Bryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top