Introduction
Here we have to discuss the Whether the user entered date is less than the current date this has been checked by using javascript call the script on textChanged or button click event. Technologies:
ASP.NET
Language:
Javascript
Implementation try this simple javascript
{codecitation class="brush: javascript; gutter: true;" width="500px"}
function dateValidation()
{ var obj = document.getElementById("");
var day = obj.value.split("/")[0]; var month = obj.value.split("/")[1];
var year = obj.value.split("/")[2]; if ((day31) || (month12)&&(year.length != 4))
{ alert("Invalid Format");return false;
}
else
{ var dt = new Date(year, month-1, day);
var today = new Date(); if((dt.getDate() != day) || (dt.getMonth() != month-1) || (dt.getFullYear()!=year) || (dt>today))
{ alert("Invalid Date");return false;
}
}
} {/codecitation} Thank you Venkat |