Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Only today's date or future date

function BirthDateValidation(dt) {
var dtToday = new Date();
var pastDate = new Date(Date.parse(dtToday.getMonth() + "/" + dtToday.getDate() + "/" + parseInt(dtToday.getFullYear() + 100)));
var lblmesg = document.getElementById("<%=lblMesg.ClientID%>");
if (dt <= pastDate) {
lblmesg.style.color = "red";
lblmesg.innerHTML = "Invalid BirthDate";
}
else {
lblmesg.style.color = "green";
lblmesg.innerHTML = "Valid BirthDate";
}
}

// is this wrong?

when I type 11/11/1111 ,it is display a valid, how do I modify this?
Posted

Is Google down??

Kindly have a look on the following.

Date Validation in JavaScript

Date Validation in JQuery

and Kindly check this awsemoe JQUERY Plugin for all type of Validations as well.

JQuery Validation Engine

Hope it will help.
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900