Hi i Have two dynamic text boxes on stage. This script works great to set the value of the first text box:
The dynamic text boxes have a default value of: "dd - mm - yy"
If i wanted to check if this is the value of the first text box (text box Var: ckin, second text box Var: ckout), and if not the default dd-mm-yy value then use it in the script.
My problem is that when i trace date2 below i get value of:
22 May 2007
And when i trace date2 after the "}else{" i get:
Tue May 1 12:10:33 GMT-0700 2007
I think the formatting of the two date2 in either senerio are screwing up the script, any thoughts on how to fix it/make it work? Thanks
Code:
date2 = new Date();
this.yearval = date2.getFullYear();
curday = date2.getDate();
SetMY(date2.getMonth() + 1, this.yearval); //1 based month
delete date2;
ShowCal();
The dynamic text boxes have a default value of: "dd - mm - yy"
If i wanted to check if this is the value of the first text box (text box Var: ckin, second text box Var: ckout), and if not the default dd-mm-yy value then use it in the script.
My problem is that when i trace date2 below i get value of:
22 May 2007
And when i trace date2 after the "}else{" i get:
Tue May 1 12:10:33 GMT-0700 2007
I think the formatting of the two date2 in either senerio are screwing up the script, any thoughts on how to fix it/make it work? Thanks
Code:
function ShowToday()
{
if (_root.ckin <> "dd - mm - yy") {
date2 = _root.ckin; //SetMY(date2.getMonth() + 1, this.yearval);
//trace(date2);
this.yearval = date2.getFullYear();
curday = date2.getDate();
SetMY(date2.getMonth() + 1, this.yearval); //1 based month
delete date2;
ShowCal();
}else{
date2 = new Date();
//trace(date2);
this.yearval = date2.getFullYear();
curday = date2.getDate();
SetMY(date2.getMonth() + 1, this.yearval); //1 based month
delete date2;
ShowCal();
}
}