Hi All,
I have a problem with date comparison.
I have the following code that does not work, can
someone tell me what is it that I am doing wrong? What
is happening is that the date is comparing the date to
seconds level. If I have 09/21/2001 as the Request
Date, it is still giving the message that backdating
is not allowed. The reason is that it is less than :
09/21/2001 00:00:00
Can someone help. If you need more info please let me
know....thanks...
******************************************************************************************
<script language="JavaScript">
function validateFormInput() {
var UserDate = new Date(frmMain.RequestedDate.value);
var MinDate = new Date(frmMain.MinDate.value);
if(UserDate < MinDate){
alert("Backdating is not allowed. If you HAVE TO
backdate, then, please contact underwriting");
frmMain.RequestedEffectiveDate.focus();
return(0);
}
else{
frmMain.submit();
}
</script>
<form name="frmMain" action="index.cfm" method="post">
Requested Date:<input type="text" size="10"
maxlength="10" name="RequestedDate"
value="<cfoutput>#LSDateFormat(Now(),"mm/dd/yyyy")#</cfoutput>">
<input type="hidden" size="10" maxlength="10"
name="MinDate"
value="<cfoutput>#LSDateFormat(Now(),"mm/dd/yyyy")#</cfoutput>">
<input type="Button" value="Submit Request Date"
onclick="javascript:validateFormInput();">
</form>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists