M
Martyn Lawson
Hi,
I am performing the following code on the validation of the fromDate node:
var myDateVal =
XDocument.DOM.selectSingleNode("//my:myFields/my:fromDate").text;
if(myDateVal != "" && myDateVal != null)
{
dFromDate = new Date(myDateVal.replace("-",","))
var strDay = dFromDate.getDay()
var strWeekDay;
switch (strDay)
{
case 0:
strWeekDay = "Sunday";
break;
case 1:
strWeekDay = "Monday";
break;
case 2:
strWeekDay = "Tuesday";
break;
case 3:
strWeekDay = "Wednesday";
break;
case 4:
strWeekDay = "Thursday";
break;
case 5:
strWeekDay = "Friday";
break;
case 6:
strWeekDay = "Saturday";
break;
}
XDocument.UI.Alert(strWeekDay);
XDocument.DOM.selectSingleNode("//my:fromDay").text = strWeekDay;
The Alert displays the correct value, so i know the code is working.
However, the last line is not populating the field. I am using the exact same
method in the OnLoad event to populate another node with the current user -
this is working fine.
Does anyone have any suggestions?
Cheers,
Martyn...
I am performing the following code on the validation of the fromDate node:
var myDateVal =
XDocument.DOM.selectSingleNode("//my:myFields/my:fromDate").text;
if(myDateVal != "" && myDateVal != null)
{
dFromDate = new Date(myDateVal.replace("-",","))
var strDay = dFromDate.getDay()
var strWeekDay;
switch (strDay)
{
case 0:
strWeekDay = "Sunday";
break;
case 1:
strWeekDay = "Monday";
break;
case 2:
strWeekDay = "Tuesday";
break;
case 3:
strWeekDay = "Wednesday";
break;
case 4:
strWeekDay = "Thursday";
break;
case 5:
strWeekDay = "Friday";
break;
case 6:
strWeekDay = "Saturday";
break;
}
XDocument.UI.Alert(strWeekDay);
XDocument.DOM.selectSingleNode("//my:fromDay").text = strWeekDay;
The Alert displays the correct value, so i know the code is working.
However, the last line is not populating the field. I am using the exact same
method in the OnLoad event to populate another node with the current user -
this is working fine.
Does anyone have any suggestions?
Cheers,
Martyn...