I am having the following codes and it though i\'m having 01-Jan-2009
for DateTo
and 03-Jan-2009
for DateFrom
it\'s readi
here's more a simplified way from simple java script
<script>
//get the values
function asdf(){
var fDate=document.forms[0].fromDate.value;
var tDate=document.forms[0].toDate.value;
//Compare
if(fDate>tDate){
var dateComponentsfrom = fDate.split("/");
//split and convert into date to be more precise
var fromdate = new Date(dateComponentsfrom[2], dateComponentsfrom[1] - 1, dateComponentsfrom[0]);
var dateComponentsto = tDate.split("/");
var todate = new Date(dateComponentsto[2], dateComponentsto[1] - 1, dateComponentsto[0]);
if(fromdate>todate){
alert('from date cannot be greater than to date');
return false;
}
}
}
</script>