Question
Javascript help/question
I have a cf form with <cfinput type=text
name="dateArrived" value="#dateformat(now(), 'mm/dd/yyyy')#"
onBlur="validateForm(initiateForm)">
When the form is first loaded, I display todays date but they have the option of changing it. The only requirement is that the date cannot be greater than today.
I call the following javascript function to try and check to make sure the date entered is not greater than todays date (there is other javascript code to check for valid date formats, requried entry etc. :
function validateForm(initiateForm){
var returnStatus = true;
var today = new Date();
if (initiateForm.dateArrived.value > today)
(
alert("greater datea");
initiateForm.dateArrived.focus();
returnStatus(false);
}
But I keep getting a object error. I think I have everything defined but obviously not. What am I doing wrong and do I need this in its own function ? Seems simple enought but it will not work for me.
When the form is first loaded, I display todays date but they have the option of changing it. The only requirement is that the date cannot be greater than today.
I call the following javascript function to try and check to make sure the date entered is not greater than todays date (there is other javascript code to check for valid date formats, requried entry etc. :
function validateForm(initiateForm){
var returnStatus = true;
var today = new Date();
if (initiateForm.dateArrived.value > today)
(
alert("greater datea");
initiateForm.dateArrived.focus();
returnStatus(false);
}
But I keep getting a object error. I think I have everything defined but obviously not. What am I doing wrong and do I need this in its own function ? Seems simple enought but it will not work for me.
