scripter73
Programmer
Hi,
I want to use the CF function IsDate() in a Javascript.
IsDate() should accept a dynamic JS date variable.
Here's what I have:
<head>
<title>Untitled</title>
<script>
//declare global variables to pass back to CF
var date1;
var date2;
function todayDate(date, old)
{
var f = new Date(date);
var n = new Date(old);
//populate global JS vars with dates
date1 = f;
date2 = n;
if ((f > n))
{
alert("Good date."
}
else
{
alert("Bad date.";
}
}
todayDate("01/02/2000", "01/01/2001"
//verify the date is valid
var verifyvalue = "<cfoutput>#IsDate(01/01/2001)#</cfoutput>";
alert ("Verify value is " + verifyvalue);
</script>
</head>
IsDate() works fine when I hard-code a date, but if I say:
var verifyvalue = "<cfoutput>#IsDate(f)#</cfoutput>";
I receive an error. Any ideas?
Any help's appreciated.
Thanks,
scripter73
Change Your Thinking, Change Your Life.
I want to use the CF function IsDate() in a Javascript.
IsDate() should accept a dynamic JS date variable.
Here's what I have:
<head>
<title>Untitled</title>
<script>
//declare global variables to pass back to CF
var date1;
var date2;
function todayDate(date, old)
{
var f = new Date(date);
var n = new Date(old);
//populate global JS vars with dates
date1 = f;
date2 = n;
if ((f > n))
{
alert("Good date."
}
else
{
alert("Bad date.";
}
}
todayDate("01/02/2000", "01/01/2001"
//verify the date is valid
var verifyvalue = "<cfoutput>#IsDate(01/01/2001)#</cfoutput>";
alert ("Verify value is " + verifyvalue);
</script>
</head>
IsDate() works fine when I hard-code a date, but if I say:
var verifyvalue = "<cfoutput>#IsDate(f)#</cfoutput>";
I receive an error. Any ideas?
Any help's appreciated.
Thanks,
scripter73
Change Your Thinking, Change Your Life.