Hello all. I am pulling dates from a text field and need to compare them to make sure that the To date is >= than the From date. Here is the function that I have, although it seems to be looking at it as a number rather than a date. In other words, 8/2/2006 is showing up as larger than 8/11/2006 because 2 is greater than 1. Here is the function:
PHP Code:
if (frm.txtTargetDate.value.length && frm.txtTargetEnd.value.length) {
if (frm.txtTargetDate.value > frm.txtTargetEnd.value) {
//Message:"Please make sure that your End Date is Greater than or Equal to your Start Date."
alert("Please make sure that your \"End Date\" is \n\nGreater than or Equal to your \"Start Date\".");
frm.txtTargetEnd.focus()
return
}
}
Is there something I need to do to the numbers first?
Thanks,
parallon