I was trying to validate start date and end date. If user select the end date which is less than start date then a warning message will display which tell that End date should be greater than start date
for that i have used this Code:
[code]
function ValidateDate()
{
var StartD = document.getElementById('').value;
var EndD = document.getElementById('').value;
var endDate = new Date(EndD );
var startDate= new Date(StartD );
if(StartD != '' && EndD != '' && startDate > endDate )
{
alert("Check out date should be greater than check In Date.");
return false;
}
if(StartD == EndD )
{
alert("Check out date should be greater than check In Date.");
return false;
}
}
[/code]
and call this function onclientclick of button event.
0 comments:
Post a Comment