if (isFieldEmpty(document.forms[0].StartDate,"You must enter an Event Start Date!","text")) return false;
s =Date.parse (document.forms[0].StartDate.value);
if (isFieldEmpty(document.forms[0].ExpiryDate,"You must enter an Event Expiry Date!","text")) return false;
x = Date.parse(document.forms[0].ExpiryDate.value) ;
function Xpire()
{
alert ("Error !!! Expiry Date cannot come before start date!","text");
document.forms[0].ExpiryDate.value = ("")
}
ydate = ((s) - (x));
if (ydate <"0")
{
Xpire();
if (isFieldEmpty(document.forms[0].ExpiryDate,"You must enter an Event Expiry Date!","text")) return false;
}
else
alert ("Finished");
document.forms[0].Submitted.value = ("Yes");
document.forms[0].submit();
When comparing the dates the parse uses the day value first therefore e.g. 28 feb is regarded as being after the 27 mar
s =Date.parse (document.forms[0].StartDate.value);
if (isFieldEmpty(document.forms[0].ExpiryDate,"You must enter an Event Expiry Date!","text")) return false;
x = Date.parse(document.forms[0].ExpiryDate.value) ;
function Xpire()
{
alert ("Error !!! Expiry Date cannot come before start date!","text");
document.forms[0].ExpiryDate.value = ("")
}
ydate = ((s) - (x));
if (ydate <"0")
{
Xpire();
if (isFieldEmpty(document.forms[0].ExpiryDate,"You must enter an Event Expiry Date!","text")) return false;
}
else
alert ("Finished");
document.forms[0].Submitted.value = ("Yes");
document.forms[0].submit();
When comparing the dates the parse uses the day value first therefore e.g. 28 feb is regarded as being after the 27 mar