Hi I am currently stuck on how to carve up my regex date to then test if the date entered is in the past . if it is I would like to alert this.
I know i some how need to splice my regex but im unsure how to do this any help would be much appreciated. below is my script so far its a pretty long regex but it covers everything including leap years but like i said i know need to break it down by either substr or splice.
//start of datefield
var dateformat=/^(?:(?:31\/(?:0[13578]|1[02])|(?:29|30)\/(?:0[13-9]|1[012])|(?:0[1-9]|1\d|2[0-8])\/(?:0[1-9]|1[0-2]))\/[2-9]\d{3}|29\/02\/(?:[2-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[3579][26])00))$/;
if (!date.match(dateformat))
{
alert("format incorrect use dd/mm/yyyy make sure you are entering correct days to the month remember 30 days have september, april, june & november, only 28 days in february unless leap year next is 2016");
return false;
}
//end date field