[thelist] age verification JS???
Theodore Serbinski
need-4-speed-ski at erols.com
Sat Mar 25 23:42:51 2000
> Does anyone have any age verification javascript that they would like to
> share? What I am looking for is some JS that will check a month, a day
> and a year and compare them to today's date. If over certain
> age, do this.
Try this code:
var now=new Date();
var end=new Date("december 25, 2000");
var secsPerDay=24*60*60*1000;
var left=Math.round((end.getTime()-now.getTime())/secsPerDay+1);
if (left==0)
left='Merry Christmas!';
else if (left < 0)
left='wait till next year in 2001';
document.open();
document.write("<font class='grad' face=verdana,arial size=1><center>Days
left till Christmas:<br><b>"+left+"</b></center></font>");
document.close();
hope it works for you, let me know if you have any problems
-ted