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.
Confirm Date must be greater than Join Date using customeValidator
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

nilesh Patil94 reputationPosted Aug 19, 2012, 11:19 PM EDT
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Aug 20, 2012, 1:26 AM EDT
function validate_date(source, args) { if(Date.Parse(document.getElementById('').value'').value) args.IsValid=true; else args.IsValid=false;Nattudurai EswaramurthyRank #5,536 · 296 reputationPosted Aug 20, 2012, 1:28 AM EDT
Could you plz try the below code: