var yearDiff = 100;
var d = new Date();
var year = d.getFullYear();
var month = d.getMonth();
var day = d.getDate();
var dtToday = new Date(year - yearDiff , month, day)
mydate = new Date(DOBDate);
year = mydate.getFullYear();
month = mydate.getMonth();
day = mydate.getDate();
mydate = new Date(year, month, day);
if (mydate > dtToday) {
alert("Age can not be greater than 100 years.");
}
else {
alert("Prev Smaller");
}
var d = new Date();
var year = d.getFullYear();
var month = d.getMonth();
var day = d.getDate();
var dtToday = new Date(year - yearDiff , month, day)
mydate = new Date(DOBDate);
year = mydate.getFullYear();
month = mydate.getMonth();
day = mydate.getDate();
mydate = new Date(year, month, day);
if (mydate > dtToday) {
alert("Age can not be greater than 100 years.");
}
else {
alert("Prev Smaller");
}
No comments:
Post a Comment