OnLoad Error

B

Bryan Hughes

Hello,

I have a jscript that runs a OnLoad Event.
It works fine in the first form I created it in, but I tried adding it to a
different from and I get the following error:
Reference to undeclared namespace prefix: "my"

What is the problem?

Here is the code:
var CurrentDate = new Date(); // Create Date object with today's date.
var y = CurrentDate.getFullYear(); //Get Current Year
var d = CurrentDate.getDate(); //Get Current Day
var m = CurrentDate.getMonth() + 1; //Get Current Motnh

var StartDate = XDocument.DOM.selectSingleNode("//my:myHire");
var sdM = "7";
var sdD = "1";

var EvalDate2 = XDocument.DOM.selectSingleNode("//my:myEvaluation2");
if (EvalDate2.text == "")
{
EvalDate2.text = (sdM + "/" + sdD + "/" + y);
}

var EvalDate1 = XDocument.DOM.selectSingleNode("//my:myEvaluation1");
var ed1 = y - 1;
if (EvalDate1.text == "")
{
EvalDate1.text = (sdM + "/" + sdD + "/" + ed1);
}

-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