function validate_date(source, args) {
var joinDate = document.getElementById('<%=txt_dateofjoin.ClientID %>').value;
var confDate = document.getElementById('<%=txt_confirmationdate.ClientID %>').value;
var dt = new Date(joinDate);
var dt2 = new Date(confDate);
var myDate = dt.format("mm-dd-yyyy");
var myDate2 = dt2.format("mm-dd-yyyy");
if (myDate < myDate2)
args.IsValid = true;
else
args.IsValid = false;
}
this code is not working. There are problem with "dt.format() function" I know it but how can I validate two dates now.
Loading
Nattudurai EswaramurthyPosted Aug 20, 2012, 5:28 AM
Could you plz try the below code:
Santhosh Kumar JayaramanPosted Aug 20, 2012, 5:26 AM
function validate_date(source, args) { if(Date.Parse(document.getElementById('<%=txt_dateofjoin.ClientID %>').value'<%=txt_confirmationdate.ClientID %>').value) args.IsValid=true; else args.IsValid=false; nilesh PatilPosted Aug 20, 2012, 3:19 AM